Detonate Ivan Bombs placed by the attacker using custom warhead. - #2365
Detonate Ivan Bombs placed by the attacker using custom warhead.#2365dh381-1 wants to merge 12 commits into
Conversation
|
To Chinese users:
|
|
To Chinese users:
|
|
|
||
| DEFINE_HOOK(0x702D19, TechnoClass_ReceiveDamage_IvanBombDetonate, 0x6) | ||
| { | ||
| GET(ObjectClass*, pThis, ESI); |
There was a problem hiding this comment.
pThis should be TechnoClass*. Besides, register esi has been popped here, I think you should not use it.
pThis 应该是 TechnoClass*。另外,ESI寄存器在此处已被弹出,我认为你不该用它。
There was a problem hiding this comment.
After changing the hook location,register esi can be used
换了一个hook位置,ESI寄存器现在就可以用了
|
Nightly build for this pull request:
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build. |
| In `rulesmd.ini`: | ||
| ```ini | ||
| [SOMEWEAPON] ; WeaponType | ||
| IvanBomb.Detonate=true ; Enable bomb detonation (true/false), default: false. |
There was a problem hiding this comment.
| IvanBomb.Detonate=true ; Enable bomb detonation (true/false), default: false. | |
| IvanBomb.Detonate=false ; boolean |
If there is a fixed default value, it should be placed as the value on the right side of the equals sign; only the value type should be written after the semicolon.
| bool SkipWeaponPicking; | ||
|
|
||
| Nullable<bool> CylinderRangefinding; | ||
|
|
|
|
||
| if(auto pBomb = pThis->AttachedBomb) | ||
| { | ||
| if(auto pSourceExt = TechnoExt::TryFetch(pSource)) |
There was a problem hiding this comment.
| if(auto pSourceExt = TechnoExt::TryFetch(pSource)) | |
| if(auto pSourceExt = TechnoExt::Fetch(pSource)) |
No need use TryFetch here, you had checked pSource before.
这里不需要使用 TryFetch,你在前面已经检查过 pSource 了。
|
Other codes looking good |
Coronia
left a comment
There was a problem hiding this comment.
I think this doesn't have to be restricted to the owner's bomb. It would also be useful if another unit could detonate it. Something like this:
IvanBomb.Detonate.InvokerOnly -> whether it can only affect your own bomb or not
IvanBomb.Detonate.AffectsType -> TechnoTypes in this list can have their ivan bomb detonated by this warhead. Use empty list for all types
|
|
||
| if(auto pBomb = pThis->AttachedBomb) | ||
| { | ||
| if(auto pSourceExt = TechnoExt::TryFetch(pSource)) |
There was a problem hiding this comment.
no need to use TryFetch here since it has already been checked above
What kind of change is this?
Skip Changelog).Skip Changelog,Skip Docs).Skip Docs).Skip Changelog,Skip Docs,Skip Credits).Description
In
rulesmd.ini: