Code path debug: Difference between revisions

From Dragon Realm Wiki
Created page with "== call player;query_level() always shows 1 == <pre>/std/user.c :: query_level()</pre> This function simply returns the object variable "level", which is only modified through..."
(No difference)

Revision as of 15:31, 7 July 2020

call player;query_level() always shows 1

/std/user.c :: query_level()

This function simply returns the object variable "level", which is only modified through set_level(). set_level() does a check to see whether the previous_object() is wizardp(), or if the euid of the previous_object() is UID_ADVANCE. If not, it returns. This appears to be the root of the issue, as functions which call set_level() (such as the _improve.c command) defer setting levels by calling set_level(1). set_level(1) then 'returns' with no integer (presumably 0 by default) and I believe the player's level remains what it was, 1.