Merge pull request #14527 from Runa-Dacino/timerbugfix

Fixes runtime from mobs without minds
This commit is contained in:
Heroman3003
2023-02-22 08:53:45 +00:00
committed by CHOMPStation2
parent 0905d37574
commit 47afc212ec
@@ -16,6 +16,8 @@ Controlled by the player_tips subsystem under code/controllers/subsystems/player
//Called every 5 minutes as defined in the subsystem.
/datum/player_tips/proc/send_tips()
if(world.time > last_tip_time + tip_delay)
last_tip_time = world.time
tip_delay = rand(min_tip_delay, max_tip_delay)
var/tip = pick_tip("none") //"none" picks a random topic of advice.
var/stopWhile = 0
while(tip == last_tip) //Prevent posting the same tip twice in a row if possible, but don't force it.
@@ -23,18 +25,14 @@ Controlled by the player_tips subsystem under code/controllers/subsystems/player
stopWhile = stopWhile + 1
if(stopWhile >= 10)
break
last_tip = tip
for(var/mob/M in player_list)
if(M.is_preference_enabled(/datum/client_preference/player_tips))
if(!(M.mind.key in HasReceived))
if(!M.key && !(M.key in HasReceived))
to_chat(M, SPAN_WARNING("You have periodic player tips enabled. You may turn them off at any time with the Toggle Receiving Player Tips verb in Preferences, or in character set up under the OOC tab!\n Player tips appear every 45-75 minutes."))
HasReceived.Add(M.mind.key)
HasReceived.Add(M.key)
to_chat(M, SPAN_NOTICE("[tip]"))
last_tip = tip
last_tip_time = world.time
tip_delay = rand(min_tip_delay, max_tip_delay)