mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-27 01:00:13 +00:00
Load terrain when entering world in online mode
Add world entry callback that triggers terrain loading when receiving SMSG_LOGIN_VERIFY_WORLD. Fix coordinate conversion by applying serverToCanonical() to properly swap X/Y axes from server format.
This commit is contained in:
parent
5ecca080d5
commit
300edd2c7c
5 changed files with 72 additions and 1 deletions
|
|
@ -80,6 +80,7 @@ private:
|
|||
void spawnNpcs();
|
||||
std::string getPlayerModelPath() const;
|
||||
static const char* mapIdToName(uint32_t mapId);
|
||||
void loadOnlineWorldTerrain(uint32_t mapId, float x, float y, float z);
|
||||
|
||||
static Application* instance;
|
||||
|
||||
|
|
|
|||
|
|
@ -271,6 +271,11 @@ public:
|
|||
using HearthstoneCallback = std::function<void()>;
|
||||
void setHearthstoneCallback(HearthstoneCallback cb) { hearthstoneCallback = std::move(cb); }
|
||||
|
||||
// World entry callback (online mode - triggered when entering world)
|
||||
// Parameters: mapId, x, y, z (canonical WoW coordinates)
|
||||
using WorldEntryCallback = std::function<void(uint32_t mapId, float x, float y, float z)>;
|
||||
void setWorldEntryCallback(WorldEntryCallback cb) { worldEntryCallback_ = std::move(cb); }
|
||||
|
||||
// Cooldowns
|
||||
float getSpellCooldown(uint32_t spellId) const;
|
||||
|
||||
|
|
@ -523,6 +528,7 @@ private:
|
|||
|
||||
// ---- Phase 3: Spells ----
|
||||
HearthstoneCallback hearthstoneCallback;
|
||||
WorldEntryCallback worldEntryCallback_;
|
||||
std::vector<uint32_t> knownSpells;
|
||||
std::unordered_map<uint32_t, float> spellCooldowns; // spellId -> remaining seconds
|
||||
uint8_t castCount = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue