mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-29 15:08:02 +01:00
Refactors client data loading
This commit is contained in:
@@ -17,7 +17,19 @@
|
||||
return
|
||||
else
|
||||
target_ckey = new_ckey
|
||||
if(check_watchlist(target_ckey))
|
||||
|
||||
var/already_watched = FALSE
|
||||
var/datum/db_query/query_watch = SSdbcore.NewQuery("SELECT reason FROM watch WHERE ckey=:target_ckey", list(
|
||||
"target_ckey" = target_ckey
|
||||
))
|
||||
if(!query_watch.warn_execute())
|
||||
qdel(query_watch)
|
||||
return
|
||||
if(query_watch.NextRow())
|
||||
already_watched = TRUE
|
||||
qdel(query_watch)
|
||||
|
||||
if(already_watched)
|
||||
to_chat(usr, "<span class='redtext'>[target_ckey] is already on the watchlist.</span>")
|
||||
return
|
||||
var/reason = input(usr,"Please state the reason","Reason") as message|null
|
||||
@@ -132,18 +144,3 @@
|
||||
output += "<br>[reason]<hr style='background:#000000; border:0; height:1px'>"
|
||||
usr << browse(output, "window=watchwin;size=900x500")
|
||||
qdel(query_watchlist)
|
||||
|
||||
/proc/check_watchlist(target_ckey)
|
||||
var/datum/db_query/query_watch = SSdbcore.NewQuery("SELECT reason FROM watch WHERE ckey=:target_ckey", list(
|
||||
"target_ckey" = target_ckey
|
||||
))
|
||||
if(!query_watch.warn_execute())
|
||||
qdel(query_watch)
|
||||
return
|
||||
if(query_watch.NextRow())
|
||||
var/entry = query_watch.item[1]
|
||||
qdel(query_watch)
|
||||
return entry
|
||||
else
|
||||
qdel(query_watch)
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user