From 4873eba16072cfc939d44f9c9e1aabb6006b1487 Mon Sep 17 00:00:00 2001 From: Gent Date: Tue, 6 Oct 2020 17:57:46 -0400 Subject: [PATCH] Add overload to updateNPCPosition with rotation arg --- src/NPCManager.cpp | 5 +++++ src/NPCManager.hpp | 1 + 2 files changed, 6 insertions(+) diff --git a/src/NPCManager.cpp b/src/NPCManager.cpp index 781f06c..64f9918 100644 --- a/src/NPCManager.cpp +++ b/src/NPCManager.cpp @@ -134,6 +134,11 @@ void NPCManager::destroyNPC(int32_t id) { std::cout << "npc removed!" << std::endl; } +void NPCManager::updateNPCPosition(int32_t id, int X, int Y, int Z, int angle) { + NPCs[id]->appearanceData.iAngle = angle; + updateNPCPosition(id, X, Y, Z); +} + void NPCManager::updateNPCPosition(int32_t id, int X, int Y, int Z) { BaseNPC* npc = NPCs[id]; diff --git a/src/NPCManager.hpp b/src/NPCManager.hpp index 73b8d0f..abf0712 100644 --- a/src/NPCManager.hpp +++ b/src/NPCManager.hpp @@ -27,6 +27,7 @@ namespace NPCManager { void addNPC(std::vector viewableChunks, int32_t id); void removeNPC(std::vector viewableChunks, int32_t id); void destroyNPC(int32_t); + void updateNPCPosition(int32_t, int X, int Y, int Z, int angle); void updateNPCPosition(int32_t, int X, int Y, int Z); void sendToViewable(BaseNPC* npc, void* buf, uint32_t type, size_t size);