Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] [MODULAR] Fixes a runtime in engaged_role_play_check #2018

Merged
merged 1 commit into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/modules/events/brain_trauma.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
if(!(H.mind.assigned_role.job_flags & JOB_CREW_MEMBER)) //please stop giving my centcom admin gimmicks full body paralysis
continue
// NOVA EDIT ADD START - Station/area event candidate filtering
if(engaged_role_play_check(H, station = TRUE, dorms = TRUE))
if(!engaged_role_play_check(H, station = TRUE, dorms = TRUE))
continue
// NOVA EDIT ADD END
traumatize(H)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/events/disease_outbreak.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
if(!is_station_level(candidate.z) && !is_mining_level(candidate.z)) //Diseases can't really spread if the vector is in deep space.
continue
// NOVA EDIT ADDITION START - Station/area event candidate filtering.
if(engaged_role_play_check(candidate, station = TRUE, dorms = TRUE))
if(!engaged_role_play_check(candidate, station = TRUE, dorms = TRUE))
continue
// NOVA EDIT ADDITION END
disease_candidates += candidate
Expand Down
2 changes: 1 addition & 1 deletion code/modules/events/fake_virus.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
if(!(victim.mind?.assigned_role.job_flags & JOB_CREW_MEMBER))
continue
// NOVA EDIT ADD START - Station/area event candidate filtering
if(engaged_role_play_check(fake_virus_victims, station = TRUE, dorms = TRUE))
if(!engaged_role_play_check(fake_virus_victims, station = TRUE, dorms = TRUE))
continue
// NOVA EDIT ADD END
fake_virus_victims += victim
Expand Down
2 changes: 1 addition & 1 deletion code/modules/events/heart_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
if(!(candidate.mind.assigned_role.job_flags & JOB_CREW_MEMBER))//only crewmembers can get one, a bit unfair for some ghost roles and it wastes the event
continue
// NOVA EDIT ADD START - Station/area event candidate filtering
if(engaged_role_play_check(candidate, station = TRUE, dorms = TRUE))
if(!engaged_role_play_check(candidate, station = TRUE, dorms = TRUE))
continue
// NOVA EDIT ADD END
if(candidate.satiety <= -60 && !candidate.has_status_effect(/datum/status_effect/exercised)) //Multiple junk food items recently //No foodmaxxing for the achievement
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/obj/item/organ/internal/appendix/become_inflamed()
if(engaged_role_play_check(owner, station = TRUE, dorms = TRUE))
if(!engaged_role_play_check(owner, station = TRUE, dorms = TRUE))
return

if(!(owner.mind && owner.mind.assigned_role && owner.mind.assigned_role.job_flags & JOB_CREW_MEMBER))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
/**
* Checks if a player meets certain conditions to exclude them from event selection.
* Returns FALSE if the player is considered ineligible for the event
*/
/proc/engaged_role_play_check(mob/living/carbon/human/player, station = TRUE, dorms = TRUE)
var/turf/player_turf = get_turf(player)
var/area/player_area = get_area(player_turf)

if(station && !is_station_level(player_turf.z))
return TRUE
if(station)
if(isnull(player_turf))
if(!is_station_level(player.z))
return FALSE
else if(!is_station_level(player_turf.z))
return FALSE
if(dorms && istype(player_area, /area/station/commons/dorms))
return TRUE
return FALSE

return FALSE
return TRUE
Loading