mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Fixes potential exploit with mood quirks
Hypothetically, the player could've turned on mood, added a bunch of negative mood quirks, and then disabled it, allowing them to have what are basically free points. This fixes that.
This commit is contained in:
@@ -30,6 +30,7 @@ PROCESSING_SUBSYSTEM_DEF(quirks)
|
||||
quirk_points[initial(T.name)] = initial(T.value)
|
||||
|
||||
/datum/controller/subsystem/processing/quirks/proc/AssignQuirks(mob/living/user, client/cli, spawn_effects)
|
||||
if(!checkquirks(cli)) return// Yogs -- part of Adding Mood as Preference
|
||||
for(var/V in cli.prefs.all_quirks)
|
||||
var/datum/quirk/Q = quirks[V]
|
||||
if(Q)
|
||||
|
||||
@@ -2856,6 +2856,7 @@
|
||||
#include "yogstation\code\controllers\subsystem\research.dm"
|
||||
#include "yogstation\code\controllers\subsystem\ticker.dm"
|
||||
#include "yogstation\code\controllers\subsystem\yogs.dm"
|
||||
#include "yogstation\code\controllers\subsystem\processing\quirks.dm"
|
||||
#include "yogstation\code\datums\action.dm"
|
||||
#include "yogstation\code\datums\mind.dm"
|
||||
#include "yogstation\code\datums\mutations.dm"
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
/datum/controller/subsystem/processing/quirks/proc/checkquirks(client/cli) // Returns true when the player isn't trying to fuckin scum the mood pref stuff to exploit
|
||||
for(var/V in cli.prefs.all_quirks)
|
||||
var/datum/quirk/Q = quirks[V]
|
||||
if(Q)
|
||||
if(initial(Q.mood_quirk) && CONFIG_GET(flag/disable_human_mood) && !(cli.prefs.toggles & PREF_MOOD))
|
||||
to_chat(src,"<span class='danger'>You cannot have the quirk '[V]' with mood disabled! You shall receive no quirks this round.")
|
||||
message_admins("[key_name(cli)] just tried to exploit the mood pref system to get bonus points for their quirks.")
|
||||
return FALSE
|
||||
return TRUE
|
||||
Reference in New Issue
Block a user