1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-06-08 01:21:52 +00:00

Fix misc 10 (#1208)

* Cleanup around `Item_DropCollectible`

* Cleanup around `Math3D_Vec3fDistSq`, `Math3D_Dist2DSq`

* Material/Model naming for one dlist pair

* Minor comments fixup

* Explicit `!= NULL` check

* Signed decimal for an array of coordinates

* Fixup comments some more
This commit is contained in:
Dragorn421 2022-04-30 14:33:28 +02:00 committed by GitHub
parent 8ad90df27f
commit 72847660eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 50 additions and 47 deletions

View file

@ -931,8 +931,8 @@
<Texture Name="gSunEvening1Tex" OutName="sun_evening_1" Format="i4" Width="64" Height="31" Offset="0x4C960"/> <Texture Name="gSunEvening1Tex" OutName="sun_evening_1" Format="i4" Width="64" Height="31" Offset="0x4C960"/>
<Texture Name="gSunEvening2Tex" OutName="sun_evening_2" Format="i4" Width="64" Height="16" Offset="0x4CD40"/> <Texture Name="gSunEvening2Tex" OutName="sun_evening_2" Format="i4" Width="64" Height="16" Offset="0x4CD40"/>
<Texture Name="gSunEvening3Tex" OutName="sun_evening_3" Format="i4" Width="64" Height="16" Offset="0x4CF40"/> <Texture Name="gSunEvening3Tex" OutName="sun_evening_3" Format="i4" Width="64" Height="16" Offset="0x4CF40"/>
<DList Name="gKokiriDustMoteTextureLoadDL" Offset="0x4D160"/> <DList Name="gKokiriDustMoteMaterialDL" Offset="0x4D160"/>
<DList Name="gKokiriDustMoteDL" Offset="0x4D1A8"/> <DList Name="gKokiriDustMoteModelDL" Offset="0x4D1A8"/>
<DList Name="gSunDL" Offset="0x4D1C0"/> <DList Name="gSunDL" Offset="0x4D1C0"/>
<DList Name="gZTargetLockOnTriangleDL" Offset="0x4D450"/> <DList Name="gZTargetLockOnTriangleDL" Offset="0x4D450"/>
<DList Name="gEffFire1DL" Offset="0x4D4E0"/> <DList Name="gEffFire1DL" Offset="0x4D4E0"/>

View file

@ -9,8 +9,8 @@
#define ACTOR_NUMBER_MAX 200 #define ACTOR_NUMBER_MAX 200
#define INVISIBLE_ACTOR_MAX 20 #define INVISIBLE_ACTOR_MAX 20
#define AM_FIELD_SIZE 0x27A0 #define AM_FIELD_SIZE 0x27A0
#define MASS_IMMOVABLE 0xFF // Cannot be pushed by OC collisions #define MASS_IMMOVABLE 0xFF // Cannot be pushed by OC colliders
#define MASS_HEAVY 0xFE // Can only be pushed by OC collisions with IMMOVABLE and HEAVY objects. #define MASS_HEAVY 0xFE // Can only be pushed by OC colliders from actors with IMMOVABLE or HEAVY mass.
struct Actor; struct Actor;
struct GlobalContext; struct GlobalContext;
@ -266,6 +266,7 @@ typedef enum {
/* 0x17 */ ITEM00_TUNIC_ZORA, /* 0x17 */ ITEM00_TUNIC_ZORA,
/* 0x18 */ ITEM00_TUNIC_GORON, /* 0x18 */ ITEM00_TUNIC_GORON,
/* 0x19 */ ITEM00_BOMBS_SPECIAL, /* 0x19 */ ITEM00_BOMBS_SPECIAL,
/* 0x1A */ ITEM00_MAX,
/* 0xFF */ ITEM00_NONE = 0xFF /* 0xFF */ ITEM00_NONE = 0xFF
} Item00Type; } Item00Type;

View file

@ -195,7 +195,7 @@ typedef struct {
/* 0x00 */ Vec3f quad[4]; /* 0x00 */ Vec3f quad[4];
/* 0x30 */ Vec3s dcMid; // midpoint of vectors d, c /* 0x30 */ Vec3s dcMid; // midpoint of vectors d, c
/* 0x36 */ Vec3s baMid; // midpoint of vectors b, a /* 0x36 */ Vec3s baMid; // midpoint of vectors b, a
/* 0x3C */ f32 acDist; // distance to nearest AC collision this frame. /* 0x3C */ f32 acDistSq; // distance to nearest AC collision this frame, squared.
} ColliderQuadDim; // size = 0x40 } ColliderQuadDim; // size = 0x40
typedef struct { typedef struct {

View file

@ -1107,7 +1107,7 @@ void Fault_DisplayFrameBuffer(void) {
osViSetSpecialFeatures(OS_VI_GAMMA_OFF | OS_VI_DITHER_FILTER_ON); osViSetSpecialFeatures(OS_VI_GAMMA_OFF | OS_VI_DITHER_FILTER_ON);
osViBlack(false); osViBlack(false);
if (sFaultInstance->fb) { if (sFaultInstance->fb != NULL) {
fb = sFaultInstance->fb; fb = sFaultInstance->fb;
} else { } else {
fb = osViGetNextFramebuffer(); fb = osViGetNextFramebuffer();

View file

@ -858,7 +858,7 @@ s32 Collider_DestroyQuadDim(GlobalContext* globalCtx, ColliderQuadDim* dim) {
} }
s32 Collider_ResetQuadACDist(GlobalContext* globalCtx, ColliderQuadDim* dim) { s32 Collider_ResetQuadACDist(GlobalContext* globalCtx, ColliderQuadDim* dim) {
dim->acDist = 1.0E38f; dim->acDistSq = 1.0E38f;
return true; return true;
} }
@ -959,16 +959,16 @@ s32 Collider_ResetQuadOC(GlobalContext* globalCtx, Collider* collider) {
* otherwise returns false. Used on player AT colliders to prevent multiple collisions from registering. * otherwise returns false. Used on player AT colliders to prevent multiple collisions from registering.
*/ */
s32 Collider_QuadSetNearestAC(GlobalContext* globalCtx, ColliderQuad* quad, Vec3f* hitPos) { s32 Collider_QuadSetNearestAC(GlobalContext* globalCtx, ColliderQuad* quad, Vec3f* hitPos) {
f32 acDist; f32 acDistSq;
Vec3f dcMid; Vec3f dcMid;
if (!(quad->info.toucherFlags & TOUCH_NEAREST)) { if (!(quad->info.toucherFlags & TOUCH_NEAREST)) {
return true; return true;
} }
Math_Vec3s_ToVec3f(&dcMid, &quad->dim.dcMid); Math_Vec3s_ToVec3f(&dcMid, &quad->dim.dcMid);
acDist = Math3D_Vec3fDistSq(&dcMid, hitPos); acDistSq = Math3D_Vec3fDistSq(&dcMid, hitPos);
if (acDist < quad->dim.acDist) { if (acDistSq < quad->dim.acDistSq) {
quad->dim.acDist = acDist; quad->dim.acDistSq = acDistSq;
if (quad->info.atHit != NULL) { if (quad->info.atHit != NULL) {
Collider_ResetACBase(globalCtx, quad->info.atHit); Collider_ResetACBase(globalCtx, quad->info.atHit);
} }

View file

@ -135,10 +135,10 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
gSaveContext.entranceIndex == 0x0292 || gSaveContext.entranceIndex == 0x0476) && gSaveContext.entranceIndex == 0x0292 || gSaveContext.entranceIndex == 0x0476) &&
(gSaveContext.respawnFlag == 0)) { (gSaveContext.respawnFlag == 0)) {
Vec3s spawnPositions[] = { Vec3s spawnPositions[] = {
{ 0xF46F, 0x0139, 0x1E14 }, { -2961, 313, 7700 },
{ 0xF894, 0x0139, 0x1B67 }, { -1900, 313, 7015 },
{ 0xF035, 0x0139, 0x1B15 }, { -4043, 313, 6933 },
{ 0xF6F7, 0x0139, 0x1766 }, { -2313, 313, 5990 },
}; };
if (gSaveContext.entranceIndex == 0x028A) { if (gSaveContext.entranceIndex == 0x028A) {

View file

@ -165,7 +165,8 @@ void BgHakaTubo_DropCollectible(BgHakaTubo* this, GlobalContext* globalCtx) {
func_80078884(NA_SE_SY_CORRECT_CHIME); func_80078884(NA_SE_SY_CORRECT_CHIME);
// Drop rupees // Drop rupees
for (i = 0; i < 9; i++) { for (i = 0; i < 9; i++) {
collectible = Item_DropCollectible(globalCtx, &spawnPos, i % 3); collectible = Item_DropCollectible(
globalCtx, &spawnPos, (i % (ITEM00_RUPEE_RED - ITEM00_RUPEE_GREEN + 1)) + ITEM00_RUPEE_GREEN);
if (collectible != NULL) { if (collectible != NULL) {
collectible->actor.velocity.y = 15.0f; collectible->actor.velocity.y = 15.0f;
collectible->actor.world.rot.y = this->dyna.actor.shape.rot.y + (i * 0x1C71); collectible->actor.world.rot.y = this->dyna.actor.shape.rot.y + (i * 0x1C71);

View file

@ -251,7 +251,7 @@ void func_808B8F08(BgSpot18Obj* this, GlobalContext* globalCtx) {
func_808B8DDC(this, globalCtx); func_808B8DDC(this, globalCtx);
if (Math3D_Dist2DSq(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.z, this->dyna.actor.home.pos.x, if (Math3D_Dist2DSq(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.z, this->dyna.actor.home.pos.x,
this->dyna.actor.home.pos.z) >= 6400.0f) { this->dyna.actor.home.pos.z) >= SQ(80.0f)) {
func_808B9030(this); func_808B9030(this);
this->dyna.actor.world.pos.x = (Math_SinS(this->dyna.actor.world.rot.y) * 80.0f) + this->dyna.actor.home.pos.x; this->dyna.actor.world.pos.x = (Math_SinS(this->dyna.actor.world.rot.y) * 80.0f) + this->dyna.actor.home.pos.x;
this->dyna.actor.world.pos.z = (Math_CosS(this->dyna.actor.world.rot.y) * 80.0f) + this->dyna.actor.home.pos.z; this->dyna.actor.world.pos.z = (Math_CosS(this->dyna.actor.world.rot.y) * 80.0f) + this->dyna.actor.home.pos.z;

View file

@ -2738,7 +2738,7 @@ void BossSst_DrawHand(Actor* thisx, GlobalContext* globalCtx) {
trail2 = &this->handTrails[(idx + 2) % 7]; trail2 = &this->handTrails[(idx + 2) % 7];
for (i = 0; i < end; i++) { for (i = 0; i < end; i++) {
if (Math3D_Vec3fDistSq(&trail2->world.pos, &trail->world.pos) > 900.0f) { if (Math3D_Vec3fDistSq(&trail2->world.pos, &trail->world.pos) > SQ(30.0f)) {
Matrix_SetTranslateRotateYXZ(trail->world.pos.x, trail->world.pos.y, trail->world.pos.z, Matrix_SetTranslateRotateYXZ(trail->world.pos.x, trail->world.pos.y, trail->world.pos.z,
&trail->world.rot); &trail->world.rot);
Matrix_Scale(0.02f, 0.02f, 0.02f, MTXMODE_APPLY); Matrix_Scale(0.02f, 0.02f, 0.02f, MTXMODE_APPLY);

View file

@ -289,7 +289,7 @@ void func_809C9700(EnBox* this, GlobalContext* globalCtx) {
func_8002F5F0(&this->dyna.actor, globalCtx); func_8002F5F0(&this->dyna.actor, globalCtx);
} }
if (Math3D_Vec3fDistSq(&this->dyna.actor.world.pos, &player->actor.world.pos) > 22500.0f) { if (Math3D_Vec3fDistSq(&this->dyna.actor.world.pos, &player->actor.world.pos) > SQ(150.0f)) {
this->unk_1FB = ENBOX_STATE_0; this->unk_1FB = ENBOX_STATE_0;
} else { } else {
if (this->unk_1FB == ENBOX_STATE_0) { if (this->unk_1FB == ENBOX_STATE_0) {

View file

@ -198,7 +198,7 @@ void EnEncount1_SpawnTektites(EnEncount1* this, GlobalContext* globalCtx) {
} }
spawnPos.y = floorY; spawnPos.y = floorY;
if (Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_TITE, spawnPos.x, if (Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_TITE, spawnPos.x,
spawnPos.y, spawnPos.z, 0, 0, 0, TEKTITE_RED) != NULL) { // Red tektite spawnPos.y, spawnPos.z, 0, 0, 0, TEKTITE_RED) != NULL) {
this->curNumSpawn++; this->curNumSpawn++;
this->totalNumSpawn++; this->totalNumSpawn++;
} else { } else {

View file

@ -123,23 +123,23 @@ void func_80A7BF58(EnInsect* this) {
*/ */
s32 EnInsect_FoundNearbySoil(EnInsect* this, GlobalContext* globalCtx) { s32 EnInsect_FoundNearbySoil(EnInsect* this, GlobalContext* globalCtx) {
Actor* currentActor; Actor* currentActor;
f32 currentDistance; f32 currentDistanceSq;
f32 bestDistance; f32 bestDistanceSq;
s32 ret; s32 ret;
ret = 0; ret = 0;
currentActor = globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].head; currentActor = globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].head;
bestDistance = 6400.0f; bestDistanceSq = 6400.0f;
this->soilActor = NULL; this->soilActor = NULL;
while (currentActor != NULL) { while (currentActor != NULL) {
if (currentActor->id == ACTOR_OBJ_MAKEKINSUTA) { if (currentActor->id == ACTOR_OBJ_MAKEKINSUTA) {
currentDistance = Math3D_Dist2DSq(this->actor.world.pos.x, this->actor.world.pos.z, currentDistanceSq = Math3D_Dist2DSq(this->actor.world.pos.x, this->actor.world.pos.z,
currentActor->world.pos.x, currentActor->world.pos.z); currentActor->world.pos.x, currentActor->world.pos.z);
if (currentDistance < bestDistance && currentActor->room == this->actor.room) { if (currentDistanceSq < bestDistanceSq && currentActor->room == this->actor.room) {
ret = 1; ret = 1;
bestDistance = currentDistance; bestDistanceSq = currentDistanceSq;
this->soilActor = (ObjMakekinsuta*)currentActor; this->soilActor = (ObjMakekinsuta*)currentActor;
} }
} }
@ -429,7 +429,7 @@ void func_80A7CC3C(EnInsect* this, GlobalContext* globalCtx) {
if (this->unk_31A <= 0) { if (this->unk_31A <= 0) {
if ((this->unk_314 & 0x10) && this->soilActor != NULL && if ((this->unk_314 & 0x10) && this->soilActor != NULL &&
Math3D_Vec3fDistSq(&this->soilActor->actor.world.pos, &this->actor.world.pos) < 64.0f) { Math3D_Vec3fDistSq(&this->soilActor->actor.world.pos, &this->actor.world.pos) < SQ(8.0f)) {
this->soilActor->unk_152 = 1; this->soilActor->unk_152 = 1;
} }
Actor_Kill(&this->actor); Actor_Kill(&this->actor);

View file

@ -441,7 +441,7 @@ void EnNy_SetupDie(EnNy* this, GlobalContext* globalCtx) {
if (this->unk_1D0 == 0) { if (this->unk_1D0 == 0) {
Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xA0); Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xA0);
} else { } else {
Item_DropCollectible(globalCtx, &this->actor.world.pos, 8); Item_DropCollectible(globalCtx, &this->actor.world.pos, ITEM00_ARROWS_SMALL);
} }
Audio_PlayActorSound2(&this->actor, NA_SE_EN_NYU_DEAD); Audio_PlayActorSound2(&this->actor, NA_SE_EN_NYU_DEAD);
this->actionFunc = EnNy_Die; this->actionFunc = EnNy_Die;

View file

@ -453,7 +453,7 @@ void EnSb_Update(Actor* thisx, GlobalContext* globalCtx) {
if (!this->hitByWindArrow) { if (!this->hitByWindArrow) {
Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x80); Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x80);
} else { } else {
Item_DropCollectible(globalCtx, &this->actor.world.pos, 8); Item_DropCollectible(globalCtx, &this->actor.world.pos, ITEM00_ARROWS_SMALL);
} }
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
} }

View file

@ -72,10 +72,10 @@ void EnTuboTrap_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void EnTuboTrap_DropCollectible(EnTuboTrap* this, GlobalContext* globalCtx) { void EnTuboTrap_DropCollectible(EnTuboTrap* this, GlobalContext* globalCtx) {
s16 params = this->actor.params; s16 params = this->actor.params;
s16 param3FF = (params >> 6) & 0x3FF; s16 dropType = (params >> 6) & 0x3FF;
if (param3FF >= 0 && param3FF < 0x1A) { if (dropType >= 0 && dropType < ITEM00_MAX) {
Item_DropCollectible(globalCtx, &this->actor.world.pos, param3FF | ((params & 0x3F) << 8)); Item_DropCollectible(globalCtx, &this->actor.world.pos, dropType | ((params & 0x3F) << 8));
} }
} }

View file

@ -133,7 +133,7 @@ void func_80B5357C(EnZl3* this, GlobalContext* globalCtx) {
sp20.x = thisPos->x + ((Rand_ZeroOne() - 0.5f) * 10.0f); sp20.x = thisPos->x + ((Rand_ZeroOne() - 0.5f) * 10.0f);
sp20.y = thisPos->y; sp20.y = thisPos->y;
sp20.z = thisPos->z + ((Rand_ZeroOne() - 0.5f) * 10.0f); sp20.z = thisPos->z + ((Rand_ZeroOne() - 0.5f) * 10.0f);
Item_DropCollectible(globalCtx, &sp20, 3); Item_DropCollectible(globalCtx, &sp20, ITEM00_HEART);
} }
void func_80B53614(EnZl3* this, GlobalContext* globalCtx) { void func_80B53614(EnZl3* this, GlobalContext* globalCtx) {

View file

@ -290,7 +290,7 @@ s32 ObjBean_CheckForHorseTrample(ObjBean* this, GlobalContext* globalCtx) {
while (currentActor != NULL) { while (currentActor != NULL) {
if ((currentActor->id == ACTOR_EN_HORSE) && if ((currentActor->id == ACTOR_EN_HORSE) &&
(Math3D_Vec3fDistSq(&currentActor->world.pos, &this->dyna.actor.world.pos) < 10000.0f)) { (Math3D_Vec3fDistSq(&currentActor->world.pos, &this->dyna.actor.world.pos) < SQ(100.0f))) {
return true; return true;
} }
currentActor = currentActor->next; currentActor = currentActor->next;

View file

@ -130,8 +130,8 @@ void ObjComb_Break(ObjComb* this, GlobalContext* globalCtx) {
void ObjComb_ChooseItemDrop(ObjComb* this, GlobalContext* globalCtx) { void ObjComb_ChooseItemDrop(ObjComb* this, GlobalContext* globalCtx) {
s16 params = this->actor.params & 0x1F; s16 params = this->actor.params & 0x1F;
if ((params > 0) || (params < 0x1A)) { if ((params > 0) || (params < ITEM00_MAX)) { // conditional always true. May have been intended to be &&
if (params == 6) { if (params == ITEM00_HEART_PIECE) {
if (Flags_GetCollectible(globalCtx, (this->actor.params >> 8) & 0x3F)) { if (Flags_GetCollectible(globalCtx, (this->actor.params >> 8) & 0x3F)) {
params = -1; params = -1;
} else { } else {

View file

@ -67,7 +67,7 @@ void ObjKibako_SpawnCollectible(ObjKibako* this, GlobalContext* globalCtx) {
s16 collectible; s16 collectible;
collectible = this->actor.params & 0x1F; collectible = this->actor.params & 0x1F;
if ((collectible >= 0) && (collectible <= 0x19)) { if ((collectible >= 0) && (collectible < ITEM00_MAX)) {
Item_DropCollectible(globalCtx, &this->actor.world.pos, Item_DropCollectible(globalCtx, &this->actor.world.pos,
collectible | (((this->actor.params >> 8) & 0x3F) << 8)); collectible | (((this->actor.params >> 8) & 0x3F) << 8));
} }

View file

@ -109,7 +109,7 @@ void ObjKibako2_SpawnCollectible(ObjKibako2* this, GlobalContext* globalCtx) {
collectibleFlagTemp = this->collectibleFlag; collectibleFlagTemp = this->collectibleFlag;
itemDropped = this->dyna.actor.home.rot.x; itemDropped = this->dyna.actor.home.rot.x;
if (itemDropped >= 0 && itemDropped < 0x1A) { if (itemDropped >= 0 && itemDropped < ITEM00_MAX) {
Item_DropCollectible(globalCtx, &this->dyna.actor.world.pos, itemDropped | (collectibleFlagTemp << 8)); Item_DropCollectible(globalCtx, &this->dyna.actor.world.pos, itemDropped | (collectibleFlagTemp << 8));
} }
} }

View file

@ -85,7 +85,7 @@ static InitChainEntry sInitChain[] = {
void ObjTsubo_SpawnCollectible(ObjTsubo* this, GlobalContext* globalCtx) { void ObjTsubo_SpawnCollectible(ObjTsubo* this, GlobalContext* globalCtx) {
s16 dropParams = this->actor.params & 0x1F; s16 dropParams = this->actor.params & 0x1F;
if ((dropParams >= ITEM00_RUPEE_GREEN) && (dropParams <= ITEM00_BOMBS_SPECIAL)) { if ((dropParams >= 0) && (dropParams < ITEM00_MAX)) {
Item_DropCollectible(globalCtx, &this->actor.world.pos, Item_DropCollectible(globalCtx, &this->actor.world.pos,
(dropParams | (((this->actor.params >> 9) & 0x3F) << 8))); (dropParams | (((this->actor.params >> 9) & 0x3F) << 8)));
} }

View file

@ -493,7 +493,7 @@ void ObjectKankyo_DrawFairies(ObjectKankyo* this2, GlobalContext* globalCtx2) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_object_kankyo.c", 807); OPEN_DISPS(globalCtx->state.gfxCtx, "../z_object_kankyo.c", 807);
POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 0x14); POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 0x14);
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(gSun1Tex)); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(gSun1Tex));
gSPDisplayList(POLY_XLU_DISP++, gKokiriDustMoteTextureLoadDL); gSPDisplayList(POLY_XLU_DISP++, gKokiriDustMoteMaterialDL);
for (i = 0; i < globalCtx->envCtx.unk_EE[3]; i++) { for (i = 0; i < globalCtx->envCtx.unk_EE[3]; i++) {
Matrix_Translate(this->effects[i].base.x + this->effects[i].pos.x, Matrix_Translate(this->effects[i].base.x + this->effects[i].pos.x,
@ -560,7 +560,7 @@ void ObjectKankyo_DrawFairies(ObjectKankyo* this2, GlobalContext* globalCtx2) {
Matrix_Mult(&globalCtx->billboardMtxF, MTXMODE_APPLY); Matrix_Mult(&globalCtx->billboardMtxF, MTXMODE_APPLY);
Matrix_RotateZ(DEG_TO_RAD(globalCtx->state.frames * 20.0f), MTXMODE_APPLY); Matrix_RotateZ(DEG_TO_RAD(globalCtx->state.frames * 20.0f), MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_object_kankyo.c", 913), G_MTX_LOAD); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_object_kankyo.c", 913), G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, gKokiriDustMoteDL); gSPDisplayList(POLY_XLU_DISP++, gKokiriDustMoteModelDL);
} }
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_object_kankyo.c", 922); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_object_kankyo.c", 922);
} }

View file

@ -123,7 +123,7 @@ void func_80BADF0C(ShotSun* this, GlobalContext* globalCtx) {
s32 pad; s32 pad;
s32 params = this->actor.params & 0xFF; s32 params = this->actor.params & 0xFF;
if (Math3D_Vec3fDistSq(&this->actor.world.pos, &player->actor.world.pos) > 22500.0f) { if (Math3D_Vec3fDistSq(&this->actor.world.pos, &player->actor.world.pos) > SQ(150.0f)) {
this->unk_1A4 = 0; this->unk_1A4 = 0;
} else { } else {
if (this->unk_1A4 == 0) { if (this->unk_1A4 == 0) {

View file

@ -6064,12 +6064,13 @@ static s32 D_80854598[] = {
}; };
void func_8083E4C4(GlobalContext* globalCtx, Player* this, GetItemEntry* giEntry) { void func_8083E4C4(GlobalContext* globalCtx, Player* this, GetItemEntry* giEntry) {
s32 sp1C = giEntry->field & 0x1F; s32 dropType = giEntry->field & 0x1F;
if (!(giEntry->field & 0x80)) { if (!(giEntry->field & 0x80)) {
Item_DropCollectible(globalCtx, &this->actor.world.pos, sp1C | 0x8000); Item_DropCollectible(globalCtx, &this->actor.world.pos, dropType | 0x8000);
if ((sp1C != 4) && (sp1C != 8) && (sp1C != 9) && (sp1C != 0xA) && (sp1C != 0) && (sp1C != 1) && (sp1C != 2) && if ((dropType != ITEM00_BOMBS_A) && (dropType != ITEM00_ARROWS_SMALL) && (dropType != ITEM00_ARROWS_MEDIUM) &&
(sp1C != 0x14) && (sp1C != 0x13)) { (dropType != ITEM00_ARROWS_LARGE) && (dropType != ITEM00_RUPEE_GREEN) && (dropType != ITEM00_RUPEE_BLUE) &&
(dropType != ITEM00_RUPEE_RED) && (dropType != ITEM00_RUPEE_PURPLE) && (dropType != ITEM00_RUPEE_ORANGE)) {
Item_Give(globalCtx, giEntry->itemId); Item_Give(globalCtx, giEntry->itemId);
} }
} else { } else {