mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-22 03:27:46 +01:00
Enforces antagHUD restrictions.
antagHUD checks were missing in a few places. Can no longer join as drone, ERT member, or pAI if you have enabled antagHUD.
This commit is contained in:
@@ -302,3 +302,14 @@
|
||||
'html/images/ntlogo.png',
|
||||
'html/images/talisman.png'
|
||||
)
|
||||
|
||||
|
||||
mob/proc/MayRespawn()
|
||||
return 0
|
||||
|
||||
client/proc/MayRespawn()
|
||||
if(mob)
|
||||
return mob.MayRespawn()
|
||||
|
||||
// Something went wrong, client is usually kicked or transfered to a new mob at this point
|
||||
return 0
|
||||
|
||||
@@ -427,9 +427,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
src << "<span class='warning'>Spawning as a mouse is currently disabled.</span>"
|
||||
return
|
||||
|
||||
var/mob/dead/observer/M = usr
|
||||
if(config.antag_hud_restricted && M.has_enabled_antagHUD == 1)
|
||||
src << "<span class='warning'>antagHUD restrictions prevent you from spawning in as a mouse.</span>"
|
||||
if(!MayRespawn(1))
|
||||
return
|
||||
|
||||
var/timedifference = world.time - client.time_died_as_mouse
|
||||
@@ -620,3 +618,10 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
/mob/dead/observer/canface()
|
||||
return 1
|
||||
|
||||
mob/dead/observer/MayRespawn(var/feedback = 0)
|
||||
if(config.antag_hud_restricted && has_enabled_antagHUD == 1)
|
||||
if(feedback)
|
||||
src << "<span class='warning'>antagHUD restrictions prevent you from respawning.</span>"
|
||||
return 0
|
||||
return 1
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
/obj/item/device/mmi/digital/posibrain/proc/request_player()
|
||||
for(var/mob/dead/observer/O in player_list)
|
||||
if(O.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
|
||||
if(!O.MayRespawn())
|
||||
continue
|
||||
if(jobban_isbanned(O, "AI") && jobban_isbanned(O, "Cyborg"))
|
||||
continue
|
||||
|
||||
@@ -235,7 +235,7 @@ var/datum/paiController/paiController // Global handler for pAI candidates
|
||||
if(c.ready)
|
||||
var/found = 0
|
||||
for(var/mob/dead/observer/o in player_list)
|
||||
if(o.key == c.key)
|
||||
if(o.key == c.key && o.MayRespawn())
|
||||
found = 1
|
||||
if(found)
|
||||
available.Add(c)
|
||||
@@ -348,7 +348,7 @@ var/datum/paiController/paiController // Global handler for pAI candidates
|
||||
/datum/paiController/proc/requestRecruits(var/mob/user)
|
||||
inquirer = user
|
||||
for(var/mob/dead/observer/O in player_list)
|
||||
if(O.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
|
||||
if(!O.MayRespawn())
|
||||
continue
|
||||
if(jobban_isbanned(O, "pAI"))
|
||||
continue
|
||||
|
||||
@@ -102,6 +102,9 @@
|
||||
if(jobban_isbanned(src,"Cyborg"))
|
||||
usr << "\red You are banned from playing synthetics and cannot spawn as a drone."
|
||||
return
|
||||
|
||||
if(!MayRespawn(1))
|
||||
return
|
||||
|
||||
var/deathtime = world.time - src.timeofdeath
|
||||
if(istype(src,/mob/dead/observer))
|
||||
|
||||
@@ -527,3 +527,6 @@
|
||||
|
||||
/mob/new_player/hear_radio(var/message, var/verb="says", var/datum/language/language=null, var/part_a, var/part_b, var/mob/speaker = null, var/hard_to_hear = 0)
|
||||
return
|
||||
|
||||
mob/new_player/MayRespawn()
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user