From dea3a519cc4879baab9aaf44037e3ac2e2424110 Mon Sep 17 00:00:00 2001 From: Erthilo Date: Sat, 26 May 2012 21:54:20 +0100 Subject: [PATCH] Traitor objective picking error fix, thanks to @thvortex. Original Message: Hopefully fixes #58 Traitor objective errors I think the issue is in /datum/objective/steal/reagent not having a "weight = " like any of the other steal objectives. GenerateTheft() will use the "weight" var and not the "get_weight" proc when building its list, but the default weight defined in /datum/objective is INFINITY. PickObjectiveFromList() will then call pickweight() which does a sum of all weights stored in the list followed by <= comparisons of the total. Perhaps the total integer var wraps around into negative values. I have no idea if INFINITY is actually MAXINT, or either of the positive or negative floating point infinities. --- code/game/gamemodes/newobjective.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/game/gamemodes/newobjective.dm b/code/game/gamemodes/newobjective.dm index de5514ddd89..66e71c124a2 100644 --- a/code/game/gamemodes/newobjective.dm +++ b/code/game/gamemodes/newobjective.dm @@ -1086,6 +1086,7 @@ datum reagent + weight = 20 var/target_name New(var/text,var/joba) ..()