Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/char/char.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1791,10 +1791,17 @@ int32 char_mmo_char_tobuf( CHARACTER_INFO& info, mmo_charstatus& p ){
info.virtue = p.karma;
info.honor = p.manner;
info.jobpoint = umin( p.status_point, INT16_MAX );
#if PACKETVER >= 20081217
info.hp = p.hp;
info.maxhp = p.max_hp;
info.sp = min( p.sp, INT16_MAX );
info.maxsp = min( p.max_sp, INT16_MAX );
#else
info.hp = u32min( p.hp, INT16_MAX );
info.maxhp = u32min( p.max_hp, INT16_MAX );
info.sp = u32min( p.sp, INT16_MAX );
info.maxsp = u32min( p.max_sp, INT16_MAX );
#endif
info.speed = DEFAULT_WALK_SPEED; // p.speed;
info.job = p.class_;
info.head = p.hair;
Expand Down Expand Up @@ -1825,8 +1832,12 @@ int32 char_mmo_char_tobuf( CHARACTER_INFO& info, mmo_charstatus& p ){
info.Dex = (uint8)u16min( p.dex, UINT8_MAX );
info.Luk = (uint8)u16min( p.luk, UINT8_MAX );
info.CharNum = p.slot;
#if PACKETVER >= 20081217
info.hairColor = (uint8)u16min( p.hair_color, UINT8_MAX );
#endif
#if PACKETVER >= 20061023
info.bIsChangedCharName = ( p.rename > 0 ) ? 0 : 1;
#endif
#if (PACKETVER >= 20100720 && PACKETVER <= 20100727) || PACKETVER >= 20100803
mapindex_getmapname_ext( p.last_point.map, info.mapName );
#endif
Expand Down
14 changes: 13 additions & 1 deletion src/common/packets.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,16 @@ struct CHARACTER_INFO{
int64 maxhp;
int64 sp;
int64 maxsp;
#else
#elif PACKETVER >= 20081217
int32 hp;
int32 maxhp;
int16 sp;
int16 maxsp;
#else
int16 hp;
int16 maxhp;
int16 sp;
int16 maxsp;
#endif
int16 speed;
int16 job;
Expand All @@ -81,9 +86,16 @@ struct CHARACTER_INFO{
uint8 Int;
uint8 Dex;
uint8 Luk;
#if PACKETVER >= 20081217
uint8 CharNum;
uint8 hairColor;
int16 bIsChangedCharName;
#elif PACKETVER >= 20061023
int16 CharNum;
int16 bIsChangedCharName;
#else
int16 CharNum;
#endif
#if (PACKETVER >= 20100720 && PACKETVER <= 20100727) || PACKETVER >= 20100803
char mapName[16];
#endif
Expand Down
Loading