Skip to content
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

Skyrider claims having no chopper after landing in Estoni. #723

Closed
misanthropos opened this issue Sep 11, 2018 · 6 comments · Fixed by #1147
Closed

Skyrider claims having no chopper after landing in Estoni. #723

misanthropos opened this issue Sep 11, 2018 · 6 comments · Fixed by #1147
Labels
bug major non-vanilla Bugs introduced by Stracciatella which do not exist in the original game
Milestone

Comments

@misanthropos
Copy link
Contributor

What is wrong

I landed in Estoni with Hitman to pick up Maddog and buy some stuff. The central SAM site is mine and I had no problem landing.
First I noticed there was no Heli to board anymore. Anyhow on the map you can click the chopper and Skyrider claims he has lost his vehicle.

JA2S version Game version Vanilla bug? Used to work?
release/git eg. JA2 Gold Dutch yes/no yes/no
QuickSave.sav.gz
commit f571f92 (HEAD -> master, origin/master, origin/HEAD)
Merge: 7d66aa4 54799c6

Vanilla: no
Used to work.

savegame attached.

linux

@misanthropos
Copy link
Contributor Author

I believe the problem is loyalty in Estoni - but is this intended? I mean the central SAM site is mine. Same for Alma and Cambria and Drassen is 100%.
This might be related to being able to train militia in Estoni. That was not possible in vanilla i think.

@misanthropos
Copy link
Contributor Author

I found the problem: Somehow that Sector seems to be EnemyControlled - thats why
CanHelicopterTakeOff returns FALSE.... using gdb I changed that sector to not enemy controlled and I can continue.

@misanthropos
Copy link
Contributor Author

But Skyrider should never have been able to land there in the first place if its still occupied...

@JAsmine-ja2
Copy link
Collaborator

JAsmine-ja2 commented Jan 26, 2019

You can fix the situation by fighting (and winning ;) a battle in Estoni. The shopper gets displayed in tactical view and works as intended.
This savegame has the situation fixed by this method.
SaveGame01.zip

@ja2-derek
Copy link
Member

ja2-derek commented Jul 10, 2020

I think I found some clues.

First of all, every sector is initialized as fEnemyControlled = TRUE when campaign starts:

// Set all sectors as enemy controlled.
FOR_EACH(StrategicMapElement, i, StrategicMap)
{
i->fEnemyControlled = TRUE;
}

When a squad enters a sector, it should set fEnemyControlled to false, if there are no enemies present.

bool const is_heli_group = g.fVehicle && IsGroupTheHelicopterGroup(g);
if (!is_heli_group)
{ // Take control of sector
SetThisSectorAsPlayerControlled(g.ubSectorX, g.ubSectorY, g.ubSectorZ, FALSE);
}

See the code above. If you never entered Estoni I6 on foot before, it will stay as fEnemyControlled. So I loaded the QuickSave, and ordered the squad to leave and a few minutes later re-enter I6, the issue is resolved. Fighting an enemy in sector is not necessary.

is_heli_group should only check for a flying heli group, not a landed heli group. Landed heli should be treated the same as a squad on foot.

Another observation is: the heli automatically lands upon arrival in I6, even refueling is not yet enabled, and sector is marked as enemy controlled sector,

@ja2-derek
Copy link
Member

I suspect it is this commmit - f374ac7

The commit replaces CheckForArrivalAtRefuelPoint with IsRefuelSiteInSector, but IsRefuelSiteInSector does not consider if the refuel site is enabled (fRefuelingSiteAvailable)

@ja2-derek ja2-derek added the non-vanilla Bugs introduced by Stracciatella which do not exist in the original game label Jul 10, 2020
@lynxlynxlynx lynxlynxlynx added this to the v0.17 milestone Jul 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug major non-vanilla Bugs introduced by Stracciatella which do not exist in the original game
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants