ss13-daedalus / daedalus

A custom SS13 fork.
GNU General Public License v3.0
14 stars 8 forks source link

Traitor objective selection runtime errors #58

Closed dopeghoti closed 12 years ago

dopeghoti commented 12 years ago
runtime error: Objective picking failed. Pick_index was 21.
proc name: PickObjectiveFromList (/proc/PickObjectiveFromList)
  source file: proc.dm,839
  usr: null
  src: null
  call stack:
PickObjectiveFromList(/list (/list))
SelectObjectives("Assistant", /datum/mind (/datum/mind), 0)
traitor (/datum/game_mode/traitor): forge traitor objectives(/datum/mind (/datum/mind))
traitor (/datum/game_mode/traitor): post setup()
/datum/controller/game_ticker (/datum/controller/game_ticker): setup()
runtime error: Cannot read null.points
proc name: SelectObjectives (/proc/SelectObjectives)
  source file: proc.dm,871
  usr: null
  src: null
  call stack:
SelectObjectives("Assistant", /datum/mind (/datum/mind), 0)
traitor (/datum/game_mode/traitor): forge traitor objectives(/datum/mind (/datum/mind))
traitor (/datum/game_mode/traitor): post setup()
/datum/controller/game_ticker (/datum/controller/game_ticker): setup()
thvortex commented 12 years ago

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.