The first [bug] is bizarre, in that I'm not sure what caused it, but while out Causing Trouble, my founder came across a Death Squad Member. As my founder was armed with an M4 Carbine, I figured I'd shoot the guy. The game crashed when I hit Fight. No idea why, clicked too fast to find out the cause.
But this one last bug, where it crashes when you use an M4 Carbine to fight a Death Squad Member when you are out Causing Trouble, I have not fixed this yet, I don't have enough details to figure out the cause of this bug yet, it is a trickier one than the others. It is more of an intermittent, randomly occurring, hard to find sort of bug. The other bugs I just fixed happened in very predictable ways, always happened in the same situations.
It crashes at line 110 in fight.cpp:
sitestory->crime.push_back(CRIME_ATTACKED);
Backtrace:
#3 0x080dc8f6 in youattack () at combat/fight.cpp:110
#4 0x080d7d10 in footchase () at combat/chase.cpp:643
#5 0x080dc178 in footchase (cr=...) at combat/chase.cpp:1937
#6 0x080ec286 in attemptarrest (liberal=...,
string=0x81e2b47 "causing trouble", clearformess=0)
at daily/activities.cpp:870
#7 0x080f1c8e in doActivityTrouble (trouble=...,
clearformess=@0xbffff0af: 0 '\000') at daily/activities.cpp:2120
#8 0x080ecbe9 in funds_and_trouble (clearformess=@0xbffff0af: 0 '\000')
at daily/activities.cpp:1043
#9 0x080f9874 in advanceday (clearformess=@0xbffff0af: 0 '\000',
canseethings=1 '\001') at daily/daily.cpp:735
#10 0x08090643 in mode_base () at basemode/basemode.cpp:685
#11 0x0807afc3 in mode_title () at title/titlescreen.cpp:131
#12 0x0804b7b7 in main (argc=1, argv=0xbffff394) at game.cpp:453
The pointer sitestory is not null but the values it points at suggest they're garbage. This hints at sitestory not being null earlier in line 859 in activities.cpp when it's expected. I don't have more time to look at it now though.