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.
This commit is contained in:
Krausus
2015-05-14 06:18:03 -04:00
parent b89c01391a
commit d74a016a1d
+5 -2
View File
@@ -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()]\] <font color='red'>Has [what_done] [target.name][ismob(target) ? "([target.ckey])" : ""][object ? " with [object]" : " "][addition]</font>")
if(ismob(target))
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been [what_done] by [user.name][ismob(user) ? "([user.ckey])" : ""][object ? " with [object]" : " "][addition]</font>")
log_attack("<font color='red'>[user.name][ismob(user) ? "([user.ckey])" : ""] [what_done] [target.name][ismob(target) ? "([target.ckey])" : ""][object ? " with [object]" : " "][addition]</font>")
if(admin)
log_attack("<font color='red'>[user.name][ismob(user) ? "([user.ckey])" : ""] [what_done] [target.name][ismob(target) ? "([target.ckey])" : ""][object ? " with [object]" : " "][addition]</font>")
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](<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[target.x];Y=[target.y];Z=[target.z]'>JMP</a>)")