diff options
| author | theo3 <arisstephenson2@gmail.com> | 2021-11-11 21:18:48 -0800 |
|---|---|---|
| committer | theo3 <arisstephenson2@gmail.com> | 2021-11-11 21:18:48 -0800 |
| commit | fddb4abd534ef1ef623cb044bc97c45713fbcfd1 (patch) | |
| tree | 4668fa2e16aa441da3c2f06b8d9b54c9762c2523 /src/object.c | |
| parent | 313cc336f21fcf81e3e336b4fe45ca5053771f93 (diff) | |
move entity update functions
Diffstat (limited to 'src/object.c')
| -rw-r--r-- | src/object.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/object.c b/src/object.c index 768c8d12..497c3c37 100644 --- a/src/object.c +++ b/src/object.c @@ -1,5 +1,6 @@ #include "global.h" #include "entity.h" +#include "manager.h" #include "object.h" void (*const gObjectFunctions[])(Entity*) = { @@ -198,3 +199,17 @@ void (*const gObjectFunctions[])(Entity*) = { [ENEMY_ITEM] = EnemyItem, [OBJECT_C1] = ObjectC1, }; + +void InitObject(Entity*); + +void ObjectUpdate(Entity* this) { + if ((this->flags & ENT_DID_INIT) == 0 && this->action == 0) + InitObject(this); + if (this->iframes != 0) + this->iframes++; + if (!CheckDontUpdate(this)) { + gObjectFunctions[this->id](this); + this->bitfield &= ~0x80; + } + DrawEntity(this); +} |
