Skip to content

Commit 33a6e2f

Browse files
authored
Local catgirl fixes a variety of random minor issues (#3823)
* Fix trying to add movable_physics to qdeleting bodyparts * Fix some quirk runtimes * Fix using `RegisterSignal` instead of `RegisterSignals` * Fix pick() from empty list with empty surgery trays. * Fix runtime error with the soft IC filter * Fix "Cannot read null.fire_state" runtime error * Fix runtime with credits passing "undefined" to `GLOB.start_state.score` * Add a check to `/datum/wound/pierce/bleed/receive_damage` to try to track down source of runtime * Fix "undefined variable /datum/status_effect/tased/var/do_afters" runtime error * Fix "Cannot execute null.adjust()" runtime error.
1 parent f95e240 commit 33a6e2f

File tree

13 files changed

+33
-23
lines changed

13 files changed

+33
-23
lines changed

code/__HELPERS/roundend.dm

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ GLOBAL_LIST_INIT(round_end_images, world.file2list("data/image_urls.txt")) // MO
103103

104104
var/datum/station_state/end_state = new /datum/station_state()
105105
end_state.count()
106-
var/station_integrity = min(PERCENT(GLOB.start_state.score(end_state)), 100)
107-
file_data["additional data"]["station integrity"] = station_integrity
106+
roundend_station_integrity = min(PERCENT(GLOB.start_state.score(end_state)), 100)
107+
file_data["additional data"]["station integrity"] = roundend_station_integrity
108108
WRITE_FILE(json_file, json_encode(file_data))
109109

110110
SSblackbox.record_feedback("nested tally", "round_end_stats", num_survivors, list("survivors", "total"))
@@ -118,7 +118,7 @@ GLOBAL_LIST_INIT(round_end_images, world.file2list("data/image_urls.txt")) // MO
118118
.[POPCOUNT_SHUTTLE_ESCAPEES] = num_shuttle_escapees
119119
.["all_mobs_on_shuttle"] = list_of_mobs_on_shuttle
120120
.["human_escapees_list"] = list_of_human_escapees
121-
.["station_integrity"] = station_integrity
121+
.["station_integrity"] = roundend_station_integrity
122122

123123
/datum/controller/subsystem/ticker/proc/gather_antag_data()
124124
var/team_gid = 1
@@ -225,6 +225,8 @@ GLOBAL_LIST_INIT(round_end_images, world.file2list("data/image_urls.txt")) // MO
225225

226226
var/speed_round = (STATION_TIME_PASSED() <= 10 MINUTES)
227227

228+
popcount = gather_roundend_feedback()
229+
228230
for(var/client/C in GLOB.clients)
229231
if(!C?.credits)
230232
C?.RollCredits()
@@ -233,7 +235,6 @@ GLOBAL_LIST_INIT(round_end_images, world.file2list("data/image_urls.txt")) // MO
233235
C?.give_award(/datum/award/achievement/misc/speed_round, C?.mob)
234236
HandleRandomHardcoreScore(C)
235237

236-
popcount = gather_roundend_feedback()
237238
display_report(popcount)
238239

239240
CHECK_TICK

code/controllers/subsystem/ticker.dm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ SUBSYSTEM_DEF(ticker)
6363
var/mode_result = "undefined"
6464
var/end_state = "undefined"
6565

66+
var/end_station_state
67+
6668
/// People who have been commended and will receive a heart
6769
var/list/hearts
6870

@@ -76,6 +78,9 @@ SUBSYSTEM_DEF(ticker)
7678

7779
var/list/popcount
7880

81+
/// (monkestation addition) The station integrity at roundend.
82+
var/roundend_station_integrity
83+
7984
/datum/controller/subsystem/ticker/Initialize()
8085
// monkestation start: fix-lobby-music
8186
var/old_login_music = trim(file2text("data/last_round_lobby_music.txt"))

code/datums/quirks/neutral_quirks.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180
// to allow all inserted replacement eyes to become heterochromatic or for it to transfer between mobs"
181181
// Then just change this to [proc/add] I really don't care
182182
/datum/quirk/heterochromatic/add_unique(client/client_source)
183-
var/color = client_source?.prefs.read_preference(/datum/preference/color/heterochromatic)
183+
var/color = client_source?.prefs?.read_preference(/datum/preference/color/heterochromatic)
184184
if(!color)
185185
return
186186

@@ -256,7 +256,7 @@
256256

257257
// Phobia will follow you between transfers
258258
/datum/quirk/phobia/add(client/client_source)
259-
var/phobia = client_source?.prefs.read_preference(/datum/preference/choiced/phobia)
259+
var/phobia = client_source?.prefs?.read_preference(/datum/preference/choiced/phobia)
260260
if(!phobia)
261261
return
262262

code/datums/wounds/pierce.dm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
return ..()
4343

4444
/datum/wound/pierce/bleed/receive_damage(wounding_type, wounding_dmg, wound_bonus, attack_direction, damage_source)
45+
if(QDELETED(victim))
46+
CRASH("Wound tried to receive damage with null/qdeling victim!")
4547
if(victim.stat == DEAD || (wounding_dmg < WOUND_MINIMUM_DAMAGE) || wounding_type == WOUND_BURN)
4648
return
4749
if(!limb.can_bleed() || !prob(internal_bleeding_chance))

code/game/objects/items/surgery_tray.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
return
147147

148148
/obj/item/surgery_tray/attack_hand(mob/living/user)
149-
if(!user.can_perform_action(src, NEED_HANDS))
149+
if(!user.can_perform_action(src, NEED_HANDS) || !length(contents))
150150
return ..()
151151
var/obj/item/grabbies = pick(contents)
152152
if(grabbies)

code/modules/mob/living/damage_procs.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
if(CLONE)
9797
damage_dealt = -1 * adjustCloneLoss(damage_amount, forced = forced)
9898
if(STAMINA)
99-
damage_dealt = -1 * stamina.adjust(-damage)
99+
damage_dealt = -1 * stamina?.adjust(-damage)
100100
if(PAIN)
101101
if(pain_controller)
102102
var/pre_pain = pain_controller.get_average_pain()

code/modules/mob/mob_say.dm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@
7373
return FALSE
7474

7575
if(soft_filter_result && !filterproof)
76-
if(tgui_alert(usr,"Your message contains \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\". \"[soft_filter_result[CHAT_FILTER_INDEX_REASON]]\", Are you sure you want to say it?", "Soft Blocked Word", list("Yes", "No")) != "Yes")
76+
if(tgui_alert(usr, "Your message contains \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\". \"[soft_filter_result[CHAT_FILTER_INDEX_REASON]]\", Are you sure you want to say it?", "Soft Blocked Word", list("Yes", "No")) != "Yes")
7777
SSblackbox.record_feedback("tally", "soft_ic_blocked_words", 1, lowertext(config.soft_ic_filter_regex.match))
78-
log_filter("Soft IC", message, filter_result)
78+
log_filter("Soft IC", message, soft_filter_result)
7979
return FALSE
8080
message_admins("[ADMIN_LOOKUPFLW(usr)] has passed the soft filter for \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\" they may be using a disallowed term. Message: \"[message]\"")
8181
log_admin_private("[key_name(usr)] has passed the soft filter for \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\" they may be using a disallowed term. Message: \"[message]\"")
8282
SSblackbox.record_feedback("tally", "passed_soft_ic_blocked_words", 1, lowertext(config.soft_ic_filter_regex.match))
83-
log_filter("Soft IC (Passed)", message, filter_result)
83+
log_filter("Soft IC (Passed)", message, soft_filter_result)
8484

8585
if(client && !(ignore_spam || forced))
8686
if(client.prefs.muted & MUTE_IC)

monkestation/code/modules/and_roll_credits/episode_names.dm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,19 @@
4343
"THE CURIOUS CASE OF [uppr_name]", "ONE HELL OF A PARTY", "FOR YOUR CONSIDERATION", "PRESS YOUR LUCK", "A STATION CALLED [uppr_name]", "CRIME AND PUNISHMENT", "MY DINNER WITH [uppr_name]", "UNFINISHED BUSINESS", "THE ONLY STATION THAT'S NOT ON FIRE (YET)", "SOMEONE'S GOTTA DO IT", "THE [uppr_name] MIX-UP", "PILOT", "PROLOGUE", "FINALE", "UNTITLED", "THE END")]")
4444
episode_names += new /datum/episode_name("[pick("SPACE", "SEXY", "DRAGON", "WARLOCK", "LAUNDRY", "GUN", "ADVERTISING", "DOG", "CARBON MONOXIDE", "NINJA", "WIZARD", "SOCRATIC", "JUVENILE DELIQUENCY", "POLITICALLY MOTIVATED", "RADTACULAR SICKNASTY", "CORPORATE", "MEGA")] [pick("QUEST", "FORCE", "ADVENTURE")]", weight=25)
4545

46-
switch(GLOB.start_state.score(SSticker.end_state))
46+
switch(SSticker.roundend_station_integrity)
4747
if(-INFINITY to -2000)
48-
episode_names += new /datum/episode_name("[pick("THE CREW'S PUNISHMENT", "A PUBLIC RELATIONS NIGHTMARE", "[uppr_name]: A NATIONAL CONCERN", "WITH APOLOGIES TO THE CREW", "THE CREW BITES THE DUST", "THE CREW BLOWS IT", "THE CREW GIVES UP THE DREAM", "THE CREW IS DONE FOR", "THE CREW SHOULD NOT BE ALLOWED ON TV", "THE END OF [uppr_name] AS WE KNOW IT")]", "Extremely low score of [GLOB.start_state.score(SSticker.end_state)].", 250)
48+
episode_names += new /datum/episode_name("[pick("THE CREW'S PUNISHMENT", "A PUBLIC RELATIONS NIGHTMARE", "[uppr_name]: A NATIONAL CONCERN", "WITH APOLOGIES TO THE CREW", "THE CREW BITES THE DUST", "THE CREW BLOWS IT", "THE CREW GIVES UP THE DREAM", "THE CREW IS DONE FOR", "THE CREW SHOULD NOT BE ALLOWED ON TV", "THE END OF [uppr_name] AS WE KNOW IT")]", "Extremely low score of [SSticker.roundend_station_integrity].", 250)
4949
if(4500 to INFINITY)
50-
episode_names += new /datum/episode_name("[pick("THE CREW'S DAY OUT", "THIS SIDE OF PARADISE", "[uppr_name]: A SITUATION COMEDY", "THE CREW'S LUNCH BREAK", "THE CREW'S BACK IN BUSINESS", "THE CREW'S BIG BREAK", "THE CREW SAVES THE DAY", "THE CREW RULES THE WORLD", "THE ONE WITH ALL THE SCIENCE AND PROGRESS AND PROMOTIONS AND ALL THE COOL AND GOOD THINGS", "THE TURNING POINT")]", "High score of [GLOB.start_state.score(SSticker.end_state)].", 250)
50+
episode_names += new /datum/episode_name("[pick("THE CREW'S DAY OUT", "THIS SIDE OF PARADISE", "[uppr_name]: A SITUATION COMEDY", "THE CREW'S LUNCH BREAK", "THE CREW'S BACK IN BUSINESS", "THE CREW'S BIG BREAK", "THE CREW SAVES THE DAY", "THE CREW RULES THE WORLD", "THE ONE WITH ALL THE SCIENCE AND PROGRESS AND PROMOTIONS AND ALL THE COOL AND GOOD THINGS", "THE TURNING POINT")]", "High score of [SSticker.roundend_station_integrity].", 250)
5151

5252
if(istype(SSticker.mode, /datum/game_mode/dynamic))
5353
var/list/ran_events = SSgamemode.triggered_round_events.Copy()
5454
switch(rand(1, 100))
5555
if(0 to 35)
5656
episode_names += new /datum/episode_name("[pick("THE DAY [uppr_name] STOOD STILL", "MUCH ADO ABOUT NOTHING", "WHERE SILENCE HAS LEASE", "RED HERRING", "HOME ALONE", "GO BIG OR GO [uppr_name]", "PLACEBO EFFECT", "ECHOES", "SILENT PARTNERS", "WITH FRIENDS LIKE THESE...", "EYE OF THE STORM", "BORN TO BE MILD", "STILL WATERS")]", "Low threat level.", 150)
57-
if(GLOB.start_state.score(SSticker.end_state) < -1000)
58-
episode_names += new /datum/episode_name/rare("[pick("HOW OH HOW DID IT ALL GO SO WRONG?!", "EXPLAIN THIS ONE TO THE EXECUTIVES", "THE CREW GOES ON SAFARI", "OUR GREATEST ENEMY", "THE INSIDE JOB", "MURDER BY PROXY")]", "Low threat levels... but the crew still had a very low score.", GLOB.start_state.score(SSticker.end_state)/150*-2)
57+
if(SSticker.roundend_station_integrity && SSticker.roundend_station_integrity < -1000)
58+
episode_names += new /datum/episode_name/rare("[pick("HOW OH HOW DID IT ALL GO SO WRONG?!", "EXPLAIN THIS ONE TO THE EXECUTIVES", "THE CREW GOES ON SAFARI", "OUR GREATEST ENEMY", "THE INSIDE JOB", "MURDER BY PROXY")]", "Low threat levels... but the crew still had a very low score.", SSticker.roundend_station_integrity/150*-2)
5959
if(35 to 60)
6060
episode_names += new /datum/episode_name("[pick("THERE MIGHT BE BLOOD", "IT CAME FROM [uppr_name]!", "THE [uppr_name] INCIDENT", "THE ENEMY WITHIN", "MIDDAY MADNESS", "AS THE CLOCK STRIKES TWELVE", "CONFIDENCE AND PARANOIA", "THE PRANK THAT WENT WAY TOO FAR", "A HOUSE DIVIDED", "[uppr_name] TO THE RESCUE!", "ESCAPE FROM [uppr_name]", \
6161
"HIT AND RUN", "THE AWAKENING", "THE GREAT ESCAPE", "THE LAST TEMPTATION OF [uppr_name]", "[uppr_name]'S FALL FROM GRACE", "BETTER THE [uppr_name] YOU KNOW...", "PLAYING WITH FIRE", "UNDER PRESSURE", "THE DAY BEFORE THE DEADLINE", "[uppr_name]'S MOST WANTED", "THE BALLAD OF [uppr_name]")]", "Moderate threat level", 150)

monkestation/code/modules/blood_datum/stunning.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@
210210
span_notice("You try to remove the electrodes!"),
211211
)
212212
// If embedding was less... difficult to work with, I would make tasers rely on an embedded object to handle this
213-
if(!do_after(src, 5 SECONDS, src, extra_checks = CALLBACK(src, PROC_REF(try_remove_taser_checks)), interaction_key = "tazed"))
213+
if(!do_after(owner, 5 SECONDS, extra_checks = CALLBACK(src, PROC_REF(try_remove_taser_checks)), interaction_key = "tazed"))
214214
return
215215
owner.visible_message(
216216
span_warning("[owner] removes the electrodes from [owner.p_their()] body!"),

monkestation/code/modules/blood_for_the_blood_gods/fly_away.dm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// Called on drop_organs for the organ to "fly away" using movable physics
22
/obj/item/organ/proc/fly_away(turf/open/owner_location, fly_angle = rand(0, 360), horizontal_multiplier = 1, vertical_multiplier = 1)
3-
if(!istype(owner_location))
3+
if(QDELETED(src) || !istype(owner_location) || QDELING(owner_location))
44
return
55
return AddComponent(/datum/component/movable_physics, \
66
physics_flags = MPHYSICS_QDEL_WHEN_NO_MOVEMENT, \
@@ -16,7 +16,7 @@
1616

1717
/// Proc called to initialize movable physics when a bodypart gets dismembered
1818
/obj/item/bodypart/proc/fly_away(turf/open/owner_location, fly_angle = rand(0, 360), horizontal_multiplier = 1, vertical_multiplier = 1)
19-
if(!istype(owner_location))
19+
if(QDELETED(src) || !istype(owner_location) || QDELING(owner_location))
2020
return
2121
pixel_x = -px_x
2222
pixel_y = -px_y
@@ -34,7 +34,7 @@
3434
)
3535

3636
/obj/item/proc/launch_item(turf/open/owner_location, fly_angle = rand(0, 360), horizontal_multiplier = 1, vertical_multiplier = 1)
37-
if(!istype(owner_location))
37+
if(QDELETED(src) || !istype(owner_location) || QDELING(owner_location))
3838
return
3939
forceMove(owner_location)
4040
return AddComponent(/datum/component/movable_physics, \

monkestation/code/modules/can_spessmen_feel_pain/pain/pain_assistance_tools.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,8 @@
372372
return
373373

374374
if(slot_flags & slot)
375-
RegisterSignal(user, list(COMSIG_LIVING_SET_BODY_POSITION, COMSIG_LIVING_SET_BUCKLED), PROC_REF(check_protection))
376-
RegisterSignal(user, list(COMSIG_QDELETING, COMSIG_MOVABLE_PRE_MOVE), PROC_REF(disable_protection))
375+
RegisterSignals(user, list(COMSIG_LIVING_SET_BODY_POSITION, COMSIG_LIVING_SET_BUCKLED), PROC_REF(check_protection))
376+
RegisterSignals(user, list(COMSIG_QDELETING, COMSIG_MOVABLE_PRE_MOVE), PROC_REF(disable_protection))
377377
try_enable(user)
378378

379379
/obj/item/shock_blanket/dropped(mob/user, silent)

monkestation/code/modules/can_spessmen_feel_pain/pain/traits.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
var/mob/living/carbon/carbon_holder = quirk_holder
5858
if(istype(carbon_holder))
5959
carbon_holder.set_pain_mod(PAIN_MOD_QUIRK, 1.2)
60-
RegisterSignal(quirk_holder, list(COMSIG_LIVING_GET_PULLED, COMSIG_CARBON_HELP_ACT), PROC_REF(cause_body_pain))
60+
RegisterSignals(quirk_holder, list(COMSIG_LIVING_GET_PULLED, COMSIG_CARBON_HELP_ACT), PROC_REF(cause_body_pain))
6161

6262
/datum/quirk/allodynia/remove()
6363
var/mob/living/carbon/carbon_holder = quirk_holder

monkestation/code/modules/liquids/liquid_groups.dm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,8 @@ GLOBAL_VAR_INIT(liquid_debug_colors, FALSE)
639639
cached_fire_spreads[burning_member] = spreading_turfs
640640

641641
/datum/liquid_group/proc/process_spread(turf/member)
642+
if(QDELETED(src) || QDELETED(member) || QDELETED(member.liquids))
643+
return
642644
if(member.liquids.fire_state <= LIQUID_FIRE_STATE_MEDIUM) // fires to small to worth spreading
643645
return
644646

0 commit comments

Comments
 (0)