diff --git a/src/m_npc.c b/src/m_npc.c index c25e0bde..9e57f4d5 100644 --- a/src/m_npc.c +++ b/src/m_npc.c @@ -362,7 +362,7 @@ extern void mNpc_CopyAnimalMemory(Anmmem_c* dst, Anmmem_c* src) { */ extern void mNpc_AddFriendship(Anmmem_c* memory, int amount) { - int friendship = memory->friendship + amount; + int friendship; /* @BUG - devs checked for memory being NULL *after* deferencing it */ #ifdef BUGFIXES @@ -371,6 +371,8 @@ extern void mNpc_AddFriendship(Anmmem_c* memory, int amount) { } #endif + friendship = memory->friendship + amount; + #ifndef BUGFIXES if (memory == NULL) {