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

Crash on Borg Assimilation combat #1

Closed
ExultantMonkey opened this issue Dec 31, 2017 · 12 comments
Closed

Crash on Borg Assimilation combat #1

ExultantMonkey opened this issue Dec 31, 2017 · 12 comments
Assignees
Labels

Comments

@ExultantMonkey
Copy link
Contributor

AssimilatedCombatEngine
// Check for IsAssmilated and in combat with Borg for (int i = 0; i < _combatShips.Count; i++) { CombatAssets ownerBorg = GetAssets(_combatShips[i].First.Owner); if (ownerBorg.Owner.Name.ToString() != "Borg") continue; goto Next; {

@KennethGF
Copy link
Contributor

KennethGF commented Jan 15, 2018

Got a crash in CombatEngine.cs at the last line of code see here, line 88 in my version. Might be something to do with surviving assets count?

_public bool IsCombatOver
{
get
{
if (_allSidesStandDown)
return true;
//if (_assets.Count(assets => assets.CombatShips.);
return (assets.Count(assets => assets.HasSurvivingAssets) <= 1);
}
}

@ExultantMonkey
Copy link
Contributor Author

That one has been reported at #6

@KennethGF
Copy link
Contributor

Getting an error out of Borg combat from PerformAssimilation() and PerformRetreat() in CombatEngine.cs?

Looking like the OnwerID is still null at some point?

System.Collections.Generic.KeyNotFoundException
HResult=0x80131577
Message=The given key was not present in the dictionary.
Source=SupremacyCore
StackTrace:
at Supremacy.Collections.KeyedCollectionBase`2.get_Item(TKey key) in C:\Users\Kenneth Flanagan\Documents\1A_20180415_BOTF2\BotF2\SupremacyCore\Collections\ObservableKeyedCollection.cs:line 107
at Supremacy.Orbitals.Fleet.OnLocationChanged() in C:\Users\Kenneth Flanagan\Documents\1A_20180415_BOTF2\BotF2\SupremacyCore\Orbitals\Fleet.cs:line 623
at Supremacy.Universe.UniverseObject.set_Location(MapLocation value) in C:\Users\Kenneth Flanagan\Documents\1A_20180415_BOTF2\BotF2\SupremacyCore\Universe\UniverseObject.cs:line 257
at Supremacy.Combat.CombatEngine.PerformRetreat() in C:\Users\Kenneth Flanagan\Documents\1A_20180415_BOTF2\BotF2\SupremacyCore\Combat\CombatEngine.cs:line 435
at Supremacy.Combat.CombatEngine.ResolveCombatRound() in C:\Users\Kenneth Flanagan\Documents\1A_20180415_BOTF2\BotF2\SupremacyCore\Combat\CombatEngine.cs:line 169
at Supremacy.WCF.SupremacyService.TryResumeCombat(CombatEngine engine) in C:\Users\Kenneth Flanagan\Documents\1A_20180415_BOTF2\BotF2\SupremacyService\SupremacyService.cs:line 1232

@KennethGF
Copy link
Contributor

KeyedCollectionBase<GameObjectID, Civiliation> is read only

So cannot be updated on assimilation? Workaround with remove and replace with a Borg game object?

@ExultantMonkey
Copy link
Contributor Author

I've had a quick look at it and the problem is that the OwnerID is null like you said, the read only has nothing to do with it.

The owner is set in CombatEngine:PerformAssimilation() with the line _ship.Fleet.OwnerID = 7;

Need to figure out how this value propogates, or even if this is the right thing to do. Surely we should be applying it to the individual ship and then transferring that ship to the Borg fleet.

Now that I know where to look I'll start working on it slowly. My time will be freeing up in the next few weeks

@bote-reginald
Copy link
Contributor

Oh God, sorry. When we unskilled coders coded this -> Borg was 7. Meanwhile we throw out "INTRO"-race we implemented for some -resolved now- UI problems. Now Borg are 6, (Fed = 0)

@ExultantMonkey
Copy link
Contributor Author

Ah, that's a nice easy fix then

@KennethGF
Copy link
Contributor

KennethGF commented May 5, 2018 via email

@ExultantMonkey
Copy link
Contributor Author

Since your doing a lot in the combat code I'll let you make the change, otherwise things might get conflicted when it goes in to master

@KennethGF
Copy link
Contributor

KennethGF commented May 6, 2018 via email

@KennethGF
Copy link
Contributor

Not crashing but working on combat with assimilated ships now

@KennethGF
Copy link
Contributor

Appears to be working

KennethGF pushed a commit that referenced this issue Jul 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants