From d74a016a1d4a0fd4bc3b1c2d135be6b4e00ad209 Mon Sep 17 00:00:00 2001 From: Krausus Date: Thu, 14 May 2015 06:18:03 -0400 Subject: [PATCH] Fixes add_logs runtiming add_logs will now respect the admin argument, which determines whether the attack goes into the file log and is shown to admins. Previously, this argument didn't exist in our codebase, and ported add_logs calls that used it would runtime. --- code/__HELPERS/mobs.dm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index 77489174db4..4658e6691ea 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -128,9 +128,10 @@ Proc for attack log creation, because really why not 3 is the description of action(like punched, throwed, or any other verb) 4 is the tool with which the action was made(usually item) 5 is additional information, anything that needs to be added +6 is whether the attack should be logged to the log file and shown to admins */ -proc/add_logs(mob/target, mob/user, what_done, var/object=null, var/addition=null) //Victim : Attacker : what they did : what they did it with : extra notes +proc/add_logs(mob/target, mob/user, what_done, var/object=null, var/addition=null, var/admin=1) //Victim : Attacker : what they did : what they did it with : extra notes var/list/ignore=list("shaked","CPRed","grabbed","punched") if(!user) return @@ -138,9 +139,11 @@ proc/add_logs(mob/target, mob/user, what_done, var/object=null, var/addition=nul user.attack_log += text("\[[time_stamp()]\] Has [what_done] [target.name][ismob(target) ? "([target.ckey])" : ""][object ? " with [object]" : " "][addition]") if(ismob(target)) target.attack_log += text("\[[time_stamp()]\] Has been [what_done] by [user.name][ismob(user) ? "([user.ckey])" : ""][object ? " with [object]" : " "][addition]") - log_attack("[user.name][ismob(user) ? "([user.ckey])" : ""] [what_done] [target.name][ismob(target) ? "([target.ckey])" : ""][object ? " with [object]" : " "][addition]") + if(admin) + log_attack("[user.name][ismob(user) ? "([user.ckey])" : ""] [what_done] [target.name][ismob(target) ? "([target.ckey])" : ""][object ? " with [object]" : " "][addition]") if(target.client) if(what_done in ignore) return if(target == user)return + if(!admin) return msg_admin_attack("[user.name][ismob(user) ? "([user.ckey])" : ""][isAntag(user) ? "(ANTAG)" : ""] [what_done] [target.name][ismob(target) ? "([target.ckey])" : ""][object ? " with [object]" : " "][addition](JMP)")