[DLL] pkScriptSystem

whoward69

DLL Minion
Joined
May 30, 2011
Messages
8,727
Location
Near Portsmouth, UK
Does anybody know why Firaxis always get a local copy of the script system, ie

Code:
ICvEngineScriptSystem1* pkScriptSystem = gDLL->GetScriptSystem();
if(pkScriptSystem)
{
  ...
}

and not just make pkScriptSystem global to the class?

It rather implies that the instance of the script system is either not re-usable/re-entrant or is somehow unique to the context the object is being called from - both of which I find hard to believe (at least in a single player / hot-seat game environment - ie the one we can write DLL mods for)

I'm wondering if it's not just (another example of) "copy-and-paste what was done before without thought" style programming
 
You could always make it global, and see what happens...

Non-reproducible and hard to explain / pinpoint CTDs are not my favourite way to design/debug software changes ;)
 
You could get a repeatable crash. I was not thinking of debugging so much, as just seeing what happens in a clean un-modded dll and one that contains only the change. If there is an immediate or regular crash then the question of "is there a reason" is answered. If there isn't, well, nothing is answered but it's a shot.
 
Back
Top Bottom