mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-13 03:32:18 -05:00
Adjust Actor_GetProjectileActor to behave more like hardware, fixing an issue with Dark Link (#4606)
This commit is contained in:
parent
caf0dc40c7
commit
fe9bf7d956
@ -2,6 +2,7 @@
|
|||||||
#include "vt.h"
|
#include "vt.h"
|
||||||
|
|
||||||
#include "overlays/actors/ovl_Arms_Hook/z_arms_hook.h"
|
#include "overlays/actors/ovl_Arms_Hook/z_arms_hook.h"
|
||||||
|
#include "overlays/actors/ovl_En_Arrow/z_en_arrow.h"
|
||||||
#include "overlays/actors/ovl_En_Part/z_en_part.h"
|
#include "overlays/actors/ovl_En_Part/z_en_part.h"
|
||||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||||
#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
|
#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
|
||||||
@ -3854,8 +3855,14 @@ Actor* Actor_GetProjectileActor(PlayState* play, Actor* refActor, f32 radius) {
|
|||||||
// it can also be an arrow.
|
// it can also be an arrow.
|
||||||
// Luckily, the field at the same offset in the arrow actor is the x component of a vector
|
// Luckily, the field at the same offset in the arrow actor is the x component of a vector
|
||||||
// which will rarely ever be 0. So it's very unlikely for this bug to cause an issue.
|
// which will rarely ever be 0. So it's very unlikely for this bug to cause an issue.
|
||||||
|
//
|
||||||
|
// SoH [Port] We're making a change here, it doesn't technically fix the bug but makes it behave
|
||||||
|
// more like hardware. Because of pointer size differences in SoH this was accessing a different
|
||||||
|
// place in memory and causing issues with Dark link behavior, and probably other places too
|
||||||
if ((Math_Vec3f_DistXYZ(&refActor->world.pos, &actor->world.pos) > radius) ||
|
if ((Math_Vec3f_DistXYZ(&refActor->world.pos, &actor->world.pos) > radius) ||
|
||||||
(((ArmsHook*)actor)->timer == 0)) {
|
(actor->id == ACTOR_ARMS_HOOK && ((ArmsHook*)actor)->timer == 0) ||
|
||||||
|
(actor->id == ACTOR_EN_ARROW && ((EnArrow*)actor)->unk_210.x == 0)
|
||||||
|
) {
|
||||||
actor = actor->next;
|
actor = actor->next;
|
||||||
} else {
|
} else {
|
||||||
deltaX = Math_SinS(actor->world.rot.y) * (actor->speedXZ * 10.0f);
|
deltaX = Math_SinS(actor->world.rot.y) * (actor->speedXZ * 10.0f);
|
||||||
|
Loading…
Reference in New Issue
Block a user