Here it is. Thanks for looking into it!
And thank you for providing details about this bug. As it turns out, it's not a bug in C3X, it's a issue in the base game which must be pretty rare. The crash is caused by a division by zero in the AI's logic to consider whether to sign a military alliance. As part of assigning a cost/value to the alliance, it determines the distance from its capital to the nearest city belonging to the target of the alliance, then computes 64 divided by that distance. Somehow the distance ends up being zero.
I'm not sure how that happens exactly. What I observed is that the human player is involved somehow because the closest city it finds is Berlin, which means it must have been searching for the city closest to Berlin's tile, but I don't know why it would do that. The fact that the crash always happens between turns 304 and 305 suggests that it's a renegotiation of an alliance signed 20 turns before that. I noticed that you don't have preserve random seed turned on. Also, I tried signing peace in your two ongoing wars and found that that solves the crash, which again confirms it's something to do with a military alliance with the human player. That's one way to fix the crash, though I didn't check whether that ruins your trade rep.
A total fix is easy too. All I have to do is insert a bit of logic that runs after the game determines the closest city distance, checks if it's zero, and if so sets it to one instead. That will be in R23 Preview 2, which I hope to post on Saturday. I'm trying to get these preview versions out more quickly.
Okay, but what if to add the inverse building_prereqs_for_units, so that the presence of some improvement in the city prohibits the production of listed units?
That wouldn't be hard as it's mostly the same logic as the existing building prereqs. I really wish I had Lua for this sort of thing. However, I don't see why using upgrades for this wouldn't work as AA mentioned. You'd have an expensive unit that upgrades to a cheap alternative that requires a building and has the same stats. Having the upgrade available would remove the expensive unit as a build option, like how connecting iron for swordsmen annoyingly makes warriors unbuildable. Even with building anti-prereqs, you'd want the cheap & expensive variations to be on the same upgrade chain anyway, no?
Hello, I downloaded the C3X mod and have tried following the instructions for getting it to work on mac. I have used Kegworks and the built in wine of porting kit. I get the attached error message every time i try to run the install.bat.
Any help would be appreciated.
I even found 'are_tiles_adjacent' in the injected code file, but my coding skills are very limited.
That's very odd. There's nothing wrong with are_tiles_adjacent per se, of course because it compiles correctly on other systems. It looks like the bool type is somehow not defined. That doesn't make sense since injected_code.c includes C3X.h, which also uses the bool type, so I'd expect this error to appear there if anywhere. You could try manually defining the bool type at the top of injected_code.c like so:
C:
typedef char bool;
#define true 1
#define false 0
Though I doubt that would work. Even if it solves this particular error, there will likely be others coming from whatever the underlying problem is.