mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 19:44:09 +01:00
Fixes TGVehicle List Access Errors (#31539)
This commit is contained in:
@@ -91,11 +91,12 @@
|
||||
if(isnull(LAZYACCESS(occupants, grant_to)) || !actiontype)
|
||||
return FALSE
|
||||
LAZYINITLIST(occupant_actions[grant_to])
|
||||
if(occupant_actions[grant_to][actiontype])
|
||||
var/list/occupant_action_list = occupant_actions[grant_to]
|
||||
if(occupant_action_list[actiontype])
|
||||
return TRUE
|
||||
var/datum/action/action = generate_action_type(actiontype)
|
||||
action.Grant(grant_to)
|
||||
occupant_actions[grant_to][action.type] = action
|
||||
occupant_action_list[action.type] = action
|
||||
return TRUE
|
||||
|
||||
/**
|
||||
@@ -112,8 +113,9 @@
|
||||
if(isnull(LAZYACCESS(occupants, take_from)) || !actiontype)
|
||||
return FALSE
|
||||
LAZYINITLIST(occupant_actions[take_from])
|
||||
if(occupant_actions[take_from][actiontype])
|
||||
var/datum/action/action = occupant_actions[take_from][actiontype]
|
||||
var/list/occupant_action_list = occupant_actions[take_from]
|
||||
if(occupant_action_list[actiontype])
|
||||
var/datum/action/action = occupant_action_list[actiontype]
|
||||
// Actions don't dissipate on removal, they just sit around assuming they'll be reusued
|
||||
// Gotta qdel
|
||||
qdel(action)
|
||||
@@ -176,9 +178,10 @@
|
||||
/obj/tgvehicle/proc/cleanup_actions_for_mob(mob/M)
|
||||
if(!istype(M))
|
||||
return FALSE
|
||||
for(var/path in occupant_actions[M])
|
||||
var/list/occupant_action_list = occupant_actions[M]
|
||||
for(var/path in occupant_action_list)
|
||||
stack_trace("Leftover action type [path] in vehicle type [type] for mob type [M.type] - THIS SHOULD NOT BE HAPPENING!")
|
||||
var/datum/action/action = occupant_actions[M][path]
|
||||
var/datum/action/action = occupant_action_list[path]
|
||||
action.Remove(M)
|
||||
occupant_actions[M] -= path
|
||||
occupant_actions -= M
|
||||
|
||||
Reference in New Issue
Block a user