Fix Death Tracking again (#18181)

* Fixes SQL Death Tracking again

Removes the foreign key constraint from the ckeys.
-> Ckeys can have different values i.e. when someone dies while aghosted the ckey becomes @ckey

Ensurs that the char_id is set to null and not 0 -> To make sure the foreign key constraint there actually works

* Simpler changelog

---------

Co-authored-by: Werner <Arrow768@users.noreply.github.com>
This commit is contained in:
Werner
2024-01-08 22:42:47 +00:00
committed by GitHub
co-authored by Werner
parent e0acdf9f73
commit 6287f394d3
3 changed files with 52 additions and 2 deletions
+2 -2
View File
@@ -259,14 +259,14 @@ GENERAL_PROTECT_DATUM(/datum/controller/subsystem/statistics)
if(!query.Execute(list(
"name"=H.real_name,
"ckey"=H.ckey,
"char_id"=H.character_id,
"char_id"=H.character_id ? H.character_id : null, //make sure we set the char id to null and not 0 so we dont violate the constraint
"job"=H?.mind?.assigned_role,
"special"=H?.mind?.special_role,
"pod"=podname,
"tod"=time2text(world.realtime, "YYYY-MM-DD hh:mm:ss"),
"laname"=H?.lastattacker?.real_name,
"lackey"=H?.lastattacker?.ckey,
"lachar_id"=H?.lastattacker?.character_id,
"lachar_id"=H?.lastattacker?.character_id ? H?.lastattacker?.character_id : null, //make sure we set the char id to null and not 0 so we dont violate the constraint
"gender"=H.gender,
"bruteloss"=H.getBruteLoss(),
"fireloss"=H.getFireLoss(),