summaryrefslogtreecommitdiff
path: root/src/object
diff options
context:
space:
mode:
Diffstat (limited to 'src/object')
-rw-r--r--src/object/bush.c2
-rw-r--r--src/object/crackingGround.c2
-rw-r--r--src/object/crenelBeanSprout.c2
-rw-r--r--src/object/flame.c2
-rw-r--r--src/object/minecart.c4
-rw-r--r--src/object/mulldozerSpawnPoint.c3
-rw-r--r--src/object/object53.c2
-rw-r--r--src/object/object70.c2
-rw-r--r--src/object/pushableStatue.c8
-rw-r--r--src/object/smallIceBlock.c2
10 files changed, 15 insertions, 14 deletions
diff --git a/src/object/bush.c b/src/object/bush.c
index 6e7a08af..38371e1e 100644
--- a/src/object/bush.c
+++ b/src/object/bush.c
@@ -50,7 +50,7 @@ void Bush_Init(BushEntity* this) {
if (super->type == 3) {
Bush_Action2SubAction5(this);
}
- sub_08004168(super);
+ SnapToTile(super);
if (super->type == 4) {
Bush_Action2SubAction5(this);
}
diff --git a/src/object/crackingGround.c b/src/object/crackingGround.c
index 3c8c9e85..fe8488c0 100644
--- a/src/object/crackingGround.c
+++ b/src/object/crackingGround.c
@@ -11,7 +11,7 @@ void CrackingGround(Entity* this) {
if (this->action == 0) {
this->action = 1;
this->timer = 20;
- sub_08004168(this);
+ SnapToTile(this);
} else {
if (this->timer-- == 0) {
sub_0807B7D8(0x35, COORD_TO_TILE(this), this->collisionLayer);
diff --git a/src/object/crenelBeanSprout.c b/src/object/crenelBeanSprout.c
index 3621f300..cdadc583 100644
--- a/src/object/crenelBeanSprout.c
+++ b/src/object/crenelBeanSprout.c
@@ -326,7 +326,7 @@ void sub_080969A4(CrenelBeanSproutEntity* this) {
void sub_08096A78(CrenelBeanSproutEntity* this) {
SetGlobalFlag(WATERBEAN_PUT);
InitAnimationForceUpdate(super, (super->type >> 1) + 8);
- sub_08004168(super);
+ SnapToTile(super);
super->y.HALF.HI += 4;
super->action = 3;
SetTile(0x403b, COORD_TO_TILE(super), super->collisionLayer);
diff --git a/src/object/flame.c b/src/object/flame.c
index 34013762..5b1b48a7 100644
--- a/src/object/flame.c
+++ b/src/object/flame.c
@@ -37,7 +37,7 @@ void Flame_Init(FlameEntity* this) {
break;
case 2:
super->timer = 15;
- sub_08004168(super);
+ SnapToTile(super);
break;
case 3:
CopyPosition(super->parent, super);
diff --git a/src/object/minecart.c b/src/object/minecart.c
index ee523716..64fb239d 100644
--- a/src/object/minecart.c
+++ b/src/object/minecart.c
@@ -186,7 +186,7 @@ void Minecart_Action3(MinecartEntity* this) {
gPlayerEntity.base.animationState = super->animationState << 1;
gPlayerEntity.base.direction = super->direction;
gPlayerEntity.base.flags |= PL_MINISH;
- sub_08004168(super);
+ SnapToTile(super);
InitAnimationForceUpdate(super, super->animationState + 0xc);
SoundReq(SFX_PLY_VO4);
SoundReq(SFX_139);
@@ -219,7 +219,7 @@ void Minecart_Action3(MinecartEntity* this) {
}
void Minecart_Action4(MinecartEntity* this) {
- sub_08004168(super);
+ SnapToTile(super);
CopyPosition(super, &gPlayerEntity.base);
switch (GetActTile(super)) {
case 0x67:
diff --git a/src/object/mulldozerSpawnPoint.c b/src/object/mulldozerSpawnPoint.c
index 8ba4d3b0..611f77dd 100644
--- a/src/object/mulldozerSpawnPoint.c
+++ b/src/object/mulldozerSpawnPoint.c
@@ -6,6 +6,7 @@
*/
#include "entity.h"
#include "sound.h"
+#include "enemy.h"
void MulldozerSpawnPoint_Init(Entity*);
void MulldozerSpawnPoint_Action1(Entity*);
@@ -37,6 +38,6 @@ void MulldozerSpawnPoint_Action1(Entity* this) {
parent = this->parent;
parent->flags = this->timer;
parent->spriteSettings.draw = this->subtimer;
- ((GenericEntity*)parent)->field_0x6c.HALF.HI &= 0xef;
+ ((Enemy*)parent)->enemyFlags &= ~EM_FLAG_SUPPORT;
}
}
diff --git a/src/object/object53.c b/src/object/object53.c
index e00e9ef2..737c8967 100644
--- a/src/object/object53.c
+++ b/src/object/object53.c
@@ -41,7 +41,7 @@ void Object53_Init(Entity* this) {
this->spriteRendering.b3 = 2;
this->zVelocity = Q_16_16(2.625);
InitializeAnimation(this, gUnk_08122288[this->type].animationState);
- sub_08004168(this);
+ SnapToTile(this);
}
void Object53_Action1(Entity* this) {
diff --git a/src/object/object70.c b/src/object/object70.c
index f9017446..605e074b 100644
--- a/src/object/object70.c
+++ b/src/object/object70.c
@@ -23,7 +23,7 @@ void Object70_Init(Entity* this) {
this->spriteSettings.draw = 1;
this->frameIndex = this->type + 0xb;
if (this->type != 0) {
- sub_08004168(this);
+ SnapToTile(this);
gPlayerEntity.base.spriteOrientation.flipY = 3;
if ((gPlayerEntity.base.spritePriority.b0) != 7) {
this->spritePriority.b0 = gPlayerEntity.base.spritePriority.b0 + 1;
diff --git a/src/object/pushableStatue.c b/src/object/pushableStatue.c
index 90ba2fc2..1755dc5b 100644
--- a/src/object/pushableStatue.c
+++ b/src/object/pushableStatue.c
@@ -106,13 +106,13 @@ void PushableStatue_SubAction0(PushableStatueEntity* this) {
this->unk_83 = 1;
index = gPlayerEntity.base.animationState;
ptr = &gUnk_08120CB4[index];
- PositionRelative(super, &gPlayerEntity.base, *(ptr) << 0x10, *(ptr + 1) << 0x10);
+ PositionRelative(super, &gPlayerEntity.base, Q_16_16(ptr[0]), Q_16_16(ptr[1]));
}
tileType = GetTileType(this->unk_84, super->collisionLayer);
if (tileType != 0x400b) {
switch (sub_0808968C(tileType)) {
case 1:
- super->direction = (((tileType - 0xc) & 3) << 3);
+ super->direction = DirectionFromAnimationState((tileType - 0xc) & 3);
sub_08089538(this);
break;
case 0:
@@ -133,7 +133,7 @@ void PushableStatue_SubAction0(PushableStatueEntity* this) {
gPlayerState.flags |= PL_BUSY;
gPlayerEntity.base.x.HALF.LO = 0;
gPlayerEntity.base.y.HALF.LO = 0;
- super->direction = (gPlayerEntity.base.animationState ^ 4) << 2;
+ super->direction = Direction8FromAnimationState(AnimationStateFlip180(gPlayerEntity.base.animationState));
sub_08089538(this);
}
}
@@ -181,7 +181,7 @@ void sub_080894C8(PushableStatueEntity* this) {
void sub_080894FC(PushableStatueEntity* this) {
u32 index;
- for (index = 0; index <= 7; index++) {
+ for (index = 0; index < 8; index++) {
if (super == gRoomVars.puzzleEntities[index]) {
gRoomVars.puzzleEntities[index] = NULL;
break;
diff --git a/src/object/smallIceBlock.c b/src/object/smallIceBlock.c
index ed2cdea1..e5a6c3f1 100644
--- a/src/object/smallIceBlock.c
+++ b/src/object/smallIceBlock.c
@@ -168,7 +168,7 @@ void SmallIceBlock_Action4(SmallIceBlockEntity* this) {
x = ((rand >> 0x10) % 9) - 4;
y = rand & 0xf;
obj->spritePriority.b0 = 3;
- PositionRelative(super, obj, x * 0x10000, -y * 0x10000);
+ PositionRelative(super, obj, Q_16_16(x), Q_16_16(-y));
}
}
}