Fixes inventory bugs

Fixes #4605
Fixes #4628

I found out why these were being improperly pooled, thanks to skowron for producing a case to reproduce and view the variables of. On login or when reset_screen() was called for a mob that had an inventory open the inventory obj/screen's were being pooled and being reused elsewhere on other objects.

Hilarity ensues!
This commit is contained in:
clusterfack
2015-06-02 21:19:37 -05:00
parent 9ab63cbd15
commit c255f7c06b
5 changed files with 27 additions and 3 deletions

View File

@@ -72,7 +72,7 @@
if(spell_masters)
for(var/obj/screen/movable/spell_master/spell_master in spell_masters)
client.screen += spell_master
spell_master.toggle_open(spell_master.showing + 1)
spell_master.toggle_open(1)
if (isobj(loc))
var/obj/location = loc

View File

@@ -7,9 +7,12 @@
unset_machine()
qdel(hud_used)
if(client)
for(var/obj/screen/movable/spell_master/spell_master in spell_masters)
returnToPool(spell_master)
remove_screen_obj_references()
for(var/atom/movable/AM in client.screen)
if(istype(AM,/obj/screen))
var/obj/screen/screenobj = AM
if(istype(screenobj) && screenobj.pool_on_reset())
returnToPool(AM)
else
qdel(AM)