Fix for potion belt name loading.

This commit is contained in:
KimLS
2014-09-25 03:59:59 -07:00
parent c0cbbf3a65
commit aa021addc1
7 changed files with 36 additions and 8 deletions
+7
View File
@@ -48,6 +48,7 @@
#include "../common/guilds.h"
#include "../common/rulesys.h"
#include "../common/spdat.h"
#include "../common/data_verification.h"
#include "petitions.h"
#include "npc_ai.h"
#include "../common/skills.h"
@@ -10490,7 +10491,13 @@ void Client::Handle_OP_PotionBelt(const EQApplicationPacket *app)
DumpPacket(app);
return;
}
MovePotionToBelt_Struct *mptbs = (MovePotionToBelt_Struct*)app->pBuffer;
if(!EQEmu::ValueWithin(mptbs->SlotNumber, 0U, 3U)) {
LogFile->write(EQEMuLog::Debug, "Client::Handle_OP_PotionBelt mptbs->SlotNumber out of range.");
return;
}
if (mptbs->Action == 0) {
const Item_Struct *BaseItem = database.GetItem(mptbs->ItemID);
if (BaseItem) {
+1
View File
@@ -301,6 +301,7 @@ luabind::scope lua_register_packet() {
.def("ReadFixedLengthString", &Lua_Packet::ReadFixedLengthString);
}
//TODO: Reorder these to match emu_oplist.h again
luabind::scope lua_register_packet_opcodes() {
return luabind::class_<Opcodes>("Opcode")
.enum_("constants")
+8 -2
View File
@@ -1178,8 +1178,14 @@ bool ZoneDatabase::LoadCharacterPotions(uint32 character_id, PlayerProfile_Struc
}
for (auto row = results.begin(); row != results.end(); ++row) {
i = atoi(row[0]); /* Potion belt slot number */
pp->potionbelt.items[i].item_id = atoi(row[1]);
pp->potionbelt.items[i].icon = atoi(row[2]);
uint32 item_id = atoi(row[1]);
const Item_Struct *item = database.GetItem(item_id);
if(item) {
pp->potionbelt.items[i].item_id = item_id;
pp->potionbelt.items[i].icon = atoi(row[2]);
strncpy(pp->potionbelt.items[i].item_name, item->Name, 64);
}
}
return true;
}