Mmmmm, it looks like an entire section of code is missing. That part I've reported here above it's meant only for AI; I'm not 100% sure what it does, but it's probably some way to buy someone to make war with someone else (not buying an ally for an ongoing war - that part is some lines above - but simply paying someone to wage war to someone else). Problem is that there's no code for this kind of trade with human players. I hope I can fix it, if you haven't already. I'll let you know.