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

Pass weaponDefID to UnitDestroyed #1665

Conversation

keelefi
Copy link
Contributor

@keelefi keelefi commented Aug 29, 2024

Closes #1639

@@ -34,7 +34,7 @@ class CFactory : public CBuilding
/// supply the build piece to speed up
float3 CalcBuildPos(int buildPiece = -1);

void KillUnit(CUnit* attacker, bool selfDestruct, bool reclaimed);
void KillUnit(CUnit* attacker, bool selfDestruct, bool reclaimed, int weaponDefID = 0);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't default to 0, this is because

  1. that represents some actual weapon (see 841 WeaponDefs is zero indexed #509),
  2. even if the above is fixed, now that every death type has its own constant there is always something appropriate to pass. There shouldn't be a case where a death was caused by some default/unknown weapon.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@keelefi keelefi force-pushed the pass-weapondefid-to-unitdestroyed branch from c453d82 to 24df270 Compare August 29, 2024 19:17
@keelefi keelefi force-pushed the pass-weapondefid-to-unitdestroyed branch from 24df270 to d1df939 Compare August 30, 2024 11:58
Pass weaponDefID to KillUnit and ForcedKillUnit so that it can be passed
to UnitDestroyed.
@lhog
Copy link
Collaborator

lhog commented Oct 6, 2024

Hmm is this a dup of aed398d ?

@keelefi
Copy link
Contributor Author

keelefi commented Oct 6, 2024

Hmm is this a dup of aed398d ?

Yes.

@keelefi keelefi closed this Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pass weaponDefID to UnitDestroyed
3 participants