From 366ffa30332e94b3d977d6be5b8fea78efc54c79 Mon Sep 17 00:00:00 2001 From: gamestabled Date: Mon, 15 Mar 2021 14:55:15 -0400 Subject: [PATCH] fixed suggestions, and also improved the similar archway.c --- include/functions.h | 2 +- src/object/archway.c | 19 +++++-------------- src/object/minishSizedArchway.c | 6 ++---- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/include/functions.h b/include/functions.h index 097c9a73..d6ce6fb3 100644 --- a/include/functions.h +++ b/include/functions.h @@ -62,7 +62,7 @@ extern void CreateDust(Entity*); extern u32 IsItemEquipped(u32); extern void DeleteManager(Manager*); extern bool32 CheckPlayerInRegion(u32 centerX, u32 centerY, u32 radiusX, u32 radiusY); -extern u32 CheckIsDungeon(); +extern u32 CheckIsDungeon(void); extern u32 GetTileTypeByEntity(Entity*); // Unidentified diff --git a/src/object/archway.c b/src/object/archway.c index 39975ee7..aa26762f 100644 --- a/src/object/archway.c +++ b/src/object/archway.c @@ -1,26 +1,17 @@ #include "global.h" #include "entity.h" #include "sprite.h" - -extern u32 CheckIsDungeon(); +#include "functions.h" void Archway(Entity* this) { - u32 v1; - u32 v2; - u32 v3; - if (this->action == 0) { - v1 = this->action = 1; - v2 = this->spriteSettings.raw; - v1 = v1 - 0x5; - v1 = v1 & v2; - this->spriteSettings.raw = v1 | 1; + this->action = 1; + this->spriteSettings.b.draw = 1; this->frameIndex = this->type2; this->collisionLayer = 2; UpdateSpriteForCollisionLayer(this); - v3 = CheckIsDungeon(); - if (v3 != 0) { - this->spritePriority.b0 = (this->spritePriority.b0 & 0xf8) | 1; + if (CheckIsDungeon()) { + this->spritePriority.b0 = 1; } } } diff --git a/src/object/minishSizedArchway.c b/src/object/minishSizedArchway.c index f7fa4266..cc1b63d3 100644 --- a/src/object/minishSizedArchway.c +++ b/src/object/minishSizedArchway.c @@ -1,8 +1,7 @@ #include "global.h" #include "entity.h" #include "sprite.h" - -extern u32 CheckIsDungeon(); +#include "functions.h" void MinishSizedArchway(Entity* this) { if (this->action == 0) { @@ -11,8 +10,7 @@ void MinishSizedArchway(Entity* this) { this->collisionLayer = 2; UpdateSpriteForCollisionLayer(this); if (CheckIsDungeon()) { - this->spritePriority.b0 = (this->spritePriority.b0 & 0xf8) | 1; + this->spritePriority.b0 = 1; } } - return; }