-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CTD when accepting King's proposal to help with war (Royal Frigate + troops) #854
Comments
CvPlayer::handleDiploEvent()
case DIPLOEVENT_ROYAL_INTERVENTION:
CvCity *locationToAppear = kPlayer.buyUnitFromParentPlayer(getID(), "UNITCLASS_ROYAL_INTERVENTIONS_SHIP", 1, "", 0, LocationFlags::LocationFlagDeepCoastal, false, false); locationToAppear is NULL, yet it is used without checking for NULL, specifically it tries to print the name of the city. Same savegame has an assert failure in CvPlayer::changeUnitClassMaking where the number for bishops is changed to -1. Right now I have more questions than answers, but at least this bug can be easily reproduced and as such testing is less of an issue than it has been with some other recent bug reports. |
At least on some occasions with this bug, I was offered King's help for less than it's nominal value of 8550 gold. Maybe this information can be helpful... |
Fixed the crash. The new ship is now placed in Europe rather than crashing on a NULL city. I found one more bug in this savegame. First the king asks you to make peace with the French and regardless of your answer, then next thing the king says is the war is dragging on and he offers to sell units. This means if you accept peace, he will offer units for the war, which isn't there. This in turn seems to make the DLL set the enemy player to player 0 (yourself), through I'm not sure that hurts anything other than possibly log entries. In short while the originally reported bug has been fixed, the savegame is still valid for bug hunting. |
@Nightinggale in another game, I received only a ship, and no troops, when ship was placed in Europe. The issue is reproducible with the save file in first post. |
Are you really talking about WTP 4.1 (develop)? Because the "Royal Interventions" should NOT even trigger in case there is no "deep water coast". The only thing that may try to place Ships in Europe are the Python Events. |
Edit: This code was definitely not written by me ...
Generally the logic for these DLL Diplo Dialogues should simply never trigger (as there are already safety checks for that) in case the Player has no Deep Harbor Coast. |
Also I am really not sure why it spawns Royal Ships and Soliders in Europe then instead of simply on the Starting Plot. Ah ok, I see. |
Of course, updated couple hours ago.
That would be unreasonably punishing for players without cities with (deep) coast tiles, don't you think? |
I was just explaining what my old logic did or at least was supposed to do - not trying to justify if it was wrong or right. Comment: |
… if the ship is added in Europe When creating the units, first the ship is added in a deep water port with Europe as fallback. The units were not included in the previous fix and were still stuck with deep water port only. Now they too have Europe as fallback.
…l back to Europe if none are found Also fixed diplo events spawning land units in Europe. They now actually appear on the dock.
This happened in a number of my games. The issue is 100% reproducible with the save file attached.
AutoSave_AD-1517-January.ColonizationSave.txt
The text was updated successfully, but these errors were encountered: