Files
VMSolidus a67a6ae94a Various Null Access Fixes (#22730)
<img width="1420" height="776" alt="image"
src="https://github.com/user-attachments/assets/d33c4ce2-9c5b-48c3-ac8b-5edfee51c7e0"
/>

Just a few fixes for some various runtime errors and two hard del
triggers on the Sentry logs.
2026-06-19 17:57:37 +00:00

52 lines
1.8 KiB
Plaintext

/datum/event/rogue_drone
endWhen = 1300
var/list/drones_list = list()
ic_name = "combat drones"
/datum/event/rogue_drone/start()
..()
//spawn them at the same place as carp
var/list/possible_spawns = list()
for(var/obj/effect/landmark/C in GLOB.landmarks_list)
if(C.name == "carpspawn")
possible_spawns.Add(C)
var/num = rand(2,10)
for(var/i=0, i<num, i++)
var/mob/living/simple_animal/hostile/icarus_drone/malf/D = new(get_turf(pick(possible_spawns)))
drones_list.Add(D)
if(prob(25))
D.disabled = rand(15, 60)
/datum/event/rogue_drone/announce()
var/message_index = rand(1, length(SSatlas.current_map.rogue_drone_detected_messages))
var/message = SSatlas.current_map.rogue_drone_detected_messages[message_index]
var/list/possible_sounds = list('sound/AI/rogue_drone_detected_message_1.ogg', 'sound/AI/rogue_drone_detected_message_2.ogg')
var/our_sound
if(length(SSatlas.current_map.rogue_drone_detected_messages > possible_sounds))
our_sound = possible_sounds[message_index]
else
our_sound = possible_sounds[1]
command_announcement.Announce(message, "Rogue Drone Alert", new_sound = our_sound, zlevels = affecting_z)
/datum/event/rogue_drone/end(var/faked)
..()
var/num_recovered = 0
for(var/mob/living/simple_animal/hostile/icarus_drone/malf/D in drones_list)
if (QDELETED(D))
continue
spark(D.loc, 3)
D.beam_out()
num_recovered++
if(!faked)
if(num_recovered > length(drones_list) * 0.75)
command_announcement.Announce(SSatlas.current_map.rogue_drone_end_message, "Rogue Drone Alert", new_sound = 'sound/AI/rogue_drone_end_message.ogg', zlevels = affecting_z)
else
command_announcement.Announce(SSatlas.current_map.rogue_drone_destroyed_message, "Rogue Drone Alert", new_sound = 'sound/AI/rogue_drone_destroyed_message.ogg', zlevels = affecting_z)
drones_list?.Cut()