From 7eb2e834b19efa21dc9cd9dd407629b0c2b3cb2c Mon Sep 17 00:00:00 2001 From: Noudess Date: Tue, 15 Oct 2019 13:22:49 -0400 Subject: [PATCH] Fix some bugs with the use of the model field in npc_types --- zone/command.cpp | 9 +++++---- zone/mob.cpp | 6 +++++- zone/mob.h | 1 + 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/zone/command.cpp b/zone/command.cpp index 1ddd99aa0..80aba0ea4 100755 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -3061,6 +3061,7 @@ void command_texture(Client *c, const Seperator *sep) { uint16 texture; + if (sep->IsNumber(1) && atoi(sep->arg[1]) >= 0 && atoi(sep->arg[1]) <= 255) { texture = atoi(sep->arg[1]); uint8 helm = 0xFF; @@ -3072,9 +3073,9 @@ void command_texture(Client *c, const Seperator *sep) { c->SendTextureWC(i, texture); } - else if ((c->GetTarget()->GetRace() > 0 && c->GetTarget()->GetRace() <= 12) || - c->GetTarget()->GetRace() == 128 || c->GetTarget()->GetRace() == 130 || - c->GetTarget()->GetRace() == 330 || c->GetTarget()->GetRace() == 522) { + else if ((c->GetTarget()->GetModel() > 0 && c->GetTarget()->GetModel() <= 12) || + c->GetTarget()->GetModel() == 128 || c->GetTarget()->GetModel() == 130 || + c->GetTarget()->GetModel() == 330 || c->GetTarget()->GetModel() == 522) { for (i = EQEmu::textures::textureBegin; i <= EQEmu::textures::LastTintableTexture; i++) { c->GetTarget()->SendTextureWC(i, texture); @@ -3093,7 +3094,7 @@ void command_texture(Client *c, const Seperator *sep) } if ((c->GetTarget()) && (c->Admin() >= commandTextureOthers)) - c->GetTarget()->SendIllusionPacket(c->GetTarget()->GetRace(), 0xFF, texture, helm); + c->GetTarget()->SendIllusionPacket(c->GetTarget()->GetModel(), 0xFF, texture, helm); else c->SendIllusionPacket(c->GetRace(), 0xFF, texture, helm); } diff --git a/zone/mob.cpp b/zone/mob.cpp index 68571b709..edaf87001 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -1736,7 +1736,11 @@ void Mob::SendIllusionPacket( uint32 new_drakkin_tattoo; uint32 new_drakkin_details; - race = (in_race) ? in_race : GetBaseRace(); + race = in_race; + if (race == 0) + { + race = (use_model) ? use_model : GetBaseRace(); + } if (in_gender != 0xFF) { diff --git a/zone/mob.h b/zone/mob.h index 56cdfbf39..21003fbd6 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -449,6 +449,7 @@ public: virtual inline uint16 GetDeity() const { return deity; } virtual EQEmu::deity::DeityTypeBit GetDeityBit() { return EQEmu::deity::ConvertDeityTypeToDeityTypeBit((EQEmu::deity::DeityType)deity); } inline uint16 GetRace() const { return race; } + inline uint16 GetModel() const { return (use_model == 0) ? race : use_model; } inline uint8 GetGender() const { return gender; } inline uint8 GetTexture() const { return texture; } inline uint8 GetHelmTexture() const { return helmtexture; }