ID:77754
 
Resolved
Fixed in 448
BYOND Version:447
Operating System:Windows XP Pro
Web Browser:-
Status: Resolved (448)

This issue has been resolved.
Descriptive Problem Summary:
Mobs don't have "screen_loc" and "animate_movement" items in their vars list, even though they have those vars and they're usable - even when accessed through the vars list!
Note that this issue is not present with objs, or even the base /atom/movable type.

A weird issue - perhaps this should be looked into to make sure vars doesn't miss some other vars under various circumstances (I haven't happened to check other objects than mobs). This would affect various code that checks if a given var is in the vars list or loops through the vars list, NOT code that actually uses the vars list to access that var (read/write value) - that works fine. So it's a minor issue (at least it is if it pertains only to these 2 specific vars and as such).

Example Code Snippet to Reproduce Problem:
mob/verb/Test_Vars()
var/mob/M = new
var/obj/O = new
var/atom/movable/A = new
for(var/v in list("screen_loc","animate_movement"))
src << "[v]: [v in A.vars], [v in O.vars], [v in M.vars]"


Expected Results of Code Snippet:
Output:
screen_loc: 1, 1, 1
animate_movement: 1, 1, 1


Actual Results of Code Snippet:
Output:
screen_loc: 1, 1, 0
animate_movement: 1, 1, 0


Does the problem occur:
  • Every time? Or how often? Every time (the issue is still present even if you use Find() instead or loop through the list manually).
  • On other computers? Unknown.


Workarounds:
When doing stuff like looping through the vars list, use special specific handling to deal with these 2 vars on mobs.
Bug fix: Looping through mob.vars skipped over animate_movement and screen_loc, although the vars could still be accessed. atom.vars was missing mouse_opacity.