mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 08:12:44 +03:00
feat(object): add Player_C_GetDisplayId
This commit is contained in:
parent
1d6b2693da
commit
c67b8fb21d
24
src/object/client/Player_C.cpp
Normal file
24
src/object/client/Player_C.cpp
Normal file
@ -0,0 +1,24 @@
|
||||
#include "object/client/Player_C.hpp"
|
||||
#include "db/Db.hpp"
|
||||
#include "object/Types.hpp"
|
||||
#include <storm/Error.hpp>
|
||||
|
||||
uint32_t Player_C_GetDisplayId(uint32_t race, uint32_t sex) {
|
||||
STORM_ASSERT(sex < UNITSEX_LAST);
|
||||
|
||||
auto raceRec = g_chrRacesDB.GetRecord(race);
|
||||
|
||||
if (!raceRec) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (sex == UNITSEX_MALE) {
|
||||
return raceRec->m_maleDisplayID;
|
||||
}
|
||||
|
||||
if (sex == UNITSEX_FEMALE) {
|
||||
return raceRec->m_femaleDisplayID;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
8
src/object/client/Player_C.hpp
Normal file
8
src/object/client/Player_C.hpp
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef OBJECT_CLIENT_PLAYER_C_HPP
|
||||
#define OBJECT_CLIENT_PLAYER_C_HPP
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
uint32_t Player_C_GetDisplayId(uint32_t race, uint32_t sex);
|
||||
|
||||
#endif
|
||||
Loading…
Reference in New Issue
Block a user