mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-10-02 20:30:17 -04:00
refactor blue fire arrows (#7209)
check damage flags instead of actors, original way could run into issues with actor unloading
This commit is contained in:
@@ -23,8 +23,8 @@ static void UpdateBlueFireCollidersBgIceShelter(void* actorPtr) {
|
||||
thisx->cylinder2.info.bumper.dmgFlags |= DMG_ARROW_ICE;
|
||||
}
|
||||
|
||||
static bool CheckAC(Actor* ac) {
|
||||
return ac != NULL && ac->id == ACTOR_EN_ARROW && ac->child != NULL && ac->child->id == ACTOR_ARROW_ICE;
|
||||
static bool HitByIceArrow(ColliderCylinder* cylinder) {
|
||||
return cylinder->info.acHitInfo != NULL && (cylinder->info.acHitInfo->toucher.dmgFlags & DMG_ARROW_ICE);
|
||||
}
|
||||
|
||||
void RegisterBlueFireArrowsHooks() {
|
||||
@@ -47,7 +47,7 @@ void RegisterBlueFireArrowsHooks() {
|
||||
COND_VB_SHOULD(VB_BG_ICE_SHELTER_MELT, shouldRegister, {
|
||||
BgIceShelter* thisx = va_arg(args, BgIceShelter*);
|
||||
|
||||
if (CheckAC(thisx->cylinder1.base.ac) || CheckAC(thisx->cylinder2.base.ac)) {
|
||||
if (HitByIceArrow(&thisx->cylinder1) || HitByIceArrow(&thisx->cylinder2)) {
|
||||
*should = true;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user