Viewing Issue Simple Details Jump to Notes ] Wiki ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0009518 [DCSS] Bug Report minor have not tried 2015-03-05 02:47 2018-01-10 02:42
Reporter Sandman25 View Status public  
Assigned To amalloy
Priority normal Resolution done  
Status resolved   Product Branch 0.17 ancient branch
Summary 0009518: Mara is not present in level annotation
Description I noticed Mara, escaped (my zombies were fighting with it out of my LoS, not sure if they could kill it) and annotated the level with "!".

59430 | Swamp:3 | Noticed Mara
60466 | Swamp:4 | Reached skill level 14 in Long Blades

Now I cannot see Mara in level annotation

Lair:8 exclusion: oklob plant
Swamp:3 !
Orc:1 1 runed door

Additional Information
Tags No tags attached.
Attached Files ? file icon unit_test_9518.patch [^] (4,591 bytes) 2015-03-10 15:41 [Show Content]

- Relationships
has duplicate 0007728closedMedar mara alive, annotation missing 

-  Notes
ForgottenBeast (reporter)
2015-03-10 15:43

First thing I'm not sure I'm respecting the project layout :
I started working on a way to expose the level annotation to lua
scripts this way :

create a function that does just that un cluautil.h
using the dgn-overview function to retrieve the data and
current_level_parent() from branch because I could not find a way to
get that information from inside the lua script.

then I added a luafn line in l_debug (it seems logical to have that
information available there) and registered the new function with lua.

Right now my problem is twofold : first I have no idea where I am,
whether I'm out of the dungeon at the start of the script or inside
it. I tried to use dgn.enter_dungeon but it resulted in a segfault. I
gave up on it since no other script use it.

If I reuse the mon-place test code I can place mara alright but I get
another segfault when calling my code to expose the level annotation
after moving down. If you may be so kind as to have a look at my
patch and give me some pointers I would be most grateful.
Kind regards
neil (administrator)
2015-03-17 22:34

A few things I noticed:

1. This test will fail if the player isn't within line-of-sight of (20, 20). Since the tests start with the player at (0,0), you probably want to move the player to an adjacent space with you.moveto.

2. The test doesn't wait for Mara to clone himself before moving to a new level, meaning it probably won't actually see the bug. Not sure what the best way to do that is.

3. debug.get_annotations should probably take the level id as the first parameter (using dlua_level_id). The other parameters aren't so important and can probably just get their default values.

4. Your LUAFN(get_annotations) is never actually used: you are using clua_push_lvl_annotations directly in debug_dlib. If you did use it, you would probably get a crash, because it doesn't return the int it is supposed to. I'd probably just move clua_push_lvl_annotations into

5. Your clua_push_lvl_annotations returns 1 if it doesn't push a value and 0 if it does. That is backwards: a C++ function callable from Lua should return the number of things it pushed onto the stack (the number of Lua return values). This might be why you were getting a segfault.

Regarding your question, tests seem to start you in an already-generated D:1 at position (0,0). I can't think of a situation where it makes sense to use debug.enter_dungeon.
amalloy (developer)
2018-01-10 02:41

Fixed in [^]

- Issue History
Date Modified Username Field Change
2015-03-05 02:47 Sandman25 New Issue
2015-03-10 15:41 ForgottenBeast File Added: unit_test_9518.patch
2015-03-10 15:43 ForgottenBeast Note Added: 0028623
2015-03-10 15:49 ForgottenBeast Issue Monitored: ForgottenBeast
2015-03-17 22:34 neil Note Added: 0028659
2015-10-20 14:01 Medar Relationship added has duplicate 0007728
2018-01-10 02:41 amalloy Note Added: 0032028
2018-01-10 02:41 amalloy Status new => resolved
2018-01-10 02:41 amalloy Fixed in Branch => longterm development (0.22+)
2018-01-10 02:41 amalloy Resolution open => done
2018-01-10 02:41 amalloy Assigned To => amalloy

Mantis 1.1.8[^]
Copyright © 2000 - 2009 Mantis Group
Powered by Mantis Bugtracker