[Bug #514] Nation Allegiance Change

Post Reply
Hypnotoad
Posts: 15
Joined: Fri Dec 14, 2012 7:25 am

[Bug #514] Nation Allegiance Change

Post by Hypnotoad » Thu Feb 28, 2013 12:12 am

As outlined by tracker bug #514:
Bug #514

The problem was that certain variables were defined as local, they would go out of scope once the function ended, thus the next function wouldn't set nation or remove gil correctly.

The fix can be done in two ways:
- Using global variables
- Checking the nation + nation rank cost in both functions (avoiding global variables)

I have included both options. Its a option of which to pick. They both achieve the same end result, although one may be slightly better than the other.
nation_allegiance_fix_global.patch
Global variables.
(4.23 KiB) Downloaded 333 times
nation_allegiance_fix_alt.patch
Local variables.
(2.08 KiB) Downloaded 330 times

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: [Bug #514] Nation Allegiance Change

Post by kjLotus » Thu Feb 28, 2013 1:24 am

globals is always a worse option


Post Reply