-
-
Notifications
You must be signed in to change notification settings - Fork 151
Detonate Ivan Bombs placed by the attacker using custom warhead. #2365
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
base: develop
Are you sure you want to change the base?
Changes from all commits
4fb6212
9b78f6e
a7a4f38
6ca4890
c32e59d
1f7c416
0465718
a3af3cf
2ce9c38
66dbf2e
2744e97
872ee5b
73e83d9
167ed8f
95b9353
daf1947
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -566,3 +566,40 @@ DEFINE_HOOK(0x737E6E, UnitClass_ReceiveDamage_SkipExplode, 0xA) | |
| R->EAX(pThis->GetHeight()); | ||
| return ContinueCheck; | ||
| } | ||
|
|
||
| DEFINE_HOOK(0x701DFF, TechnoClass_ReceiveDamage_IvanBombDetonate, 0x7) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This hook is redundant. |
||
| { | ||
| GET(TechnoClass*, pThis, ESI); | ||
| GET_STACK(TechnoClass*, pSource, STACK_OFFSET(0xC4, 0x10)); | ||
| GET_STACK(WarheadTypeClass*, pWH, STACK_OFFSET(0xC4, 0xC)); | ||
|
|
||
| if (!pSource) | ||
| return 0; | ||
|
|
||
| if(auto pBomb = pThis->AttachedBomb) | ||
| { | ||
| if(auto pSourceExt = TechnoExt::Fetch(pSource)) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this sanity check is not nesseary |
||
| { | ||
| if(auto pWHExt = WarheadTypeExt::TryFetch(pWH)) | ||
| { | ||
| if(!pWHExt->IvanBomb_Detonate) | ||
| return 0; | ||
|
|
||
| bool CanAffects = pWHExt->IvanBomb_Detonate_AffectsType.Contains(pThis->GetTechnoType()) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it will be better to check empty first |
||
| || pWHExt->IvanBomb_Detonate_AffectsType.empty(); | ||
|
|
||
| if(pWHExt->IvanBomb_Detonate_InvokerOnly) | ||
| { | ||
| if(pBomb->Owner == pSource && CanAffects) | ||
| pBomb->Detonate(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Invoking a damage in another damage process is dangerous. |
||
| } | ||
| else | ||
| { | ||
| if(CanAffects) | ||
| pBomb->Detonate(); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| return 0; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -118,6 +118,7 @@ class WeaponTypeExt final : public AbstractTypeExt | |
| bool SkipWeaponPicking; | ||
|
|
||
| Nullable<bool> CylinderRangefinding; | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what's this ? |
||
|
|
||
| WeaponTypeExt(WeaponTypeClass* OwnerObject) : AbstractTypeExt(OwnerObject) | ||
| , DiskLaser_Radius { DiskLaserClass::Radius } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is unreasonable to reinvent a filter here.