Event manager tweaks.

Moves the event manager processing into the process itself.
Ensures the last_object var is properly set in case of issues.
Also fixes a potential risk of the camera damage event looping forever.
This commit is contained in:
PsiOmegaDelta
2016-01-10 21:18:20 +01:00
parent 6cc4c26560
commit b1fea3b090
3 changed files with 11 additions and 10 deletions
+1 -1
View File
@@ -30,7 +30,7 @@
var/obj/machinery/camera/C = pick(cameranet.cameras)
if(is_valid_camera(C))
return C
return acquire_random_camera(remaining_attempts--)
return acquire_random_camera(remaining_attempts-1)
/datum/event/camera_damage/proc/is_valid_camera(var/obj/machinery/camera/C)
// Only return a functional camera, not installed in a silicon, and that exists somewhere players have access
-8
View File
@@ -23,14 +23,6 @@
/datum/event_manager/New()
allEvents = typesof(/datum/event) - /datum/event
/datum/event_manager/proc/process()
for(var/datum/event/E in event_manager.active_events)
E.process()
for(var/i = EVENT_LEVEL_MUNDANE to EVENT_LEVEL_MAJOR)
var/list/datum/event_container/EC = event_containers[i]
EC.process()
/datum/event_manager/proc/event_complete(var/datum/event/E)
if(!E.event_meta || !E.severity) // datum/event is used here and there for random reasons, maintaining "backwards compatibility"
log_debug("Event of '[E.type]' with missing meta-data has completed.")