mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
[Bug Fix] Fix IDFile Crash with spaces or invalid data. (#2597)
* [Bug Fix] Fix IDFile Crash with spaces or invalid data. * Update mob_appearance.cpp
This commit is contained in:
parent
a9cfacf54b
commit
ecc34940b4
@ -240,7 +240,7 @@ int32 Mob::GetEquipmentMaterial(uint8 material_slot) const
|
||||
if (inst) {
|
||||
if (inst->GetOrnamentationAug(ornamentation_augment_type)) {
|
||||
item = inst->GetOrnamentationAug(ornamentation_augment_type)->GetItem();
|
||||
if (item && strlen(item->IDFile) > 2) {
|
||||
if (item && strlen(item->IDFile) > 2 && Strings::IsNumber(&item->IDFile[2])) {
|
||||
equipment_material = std::stoi(&item->IDFile[2]);
|
||||
}
|
||||
} else if (inst->GetOrnamentationIDFile()) {
|
||||
@ -249,7 +249,7 @@ int32 Mob::GetEquipmentMaterial(uint8 material_slot) const
|
||||
}
|
||||
}
|
||||
|
||||
if (equipment_material == 0 && strlen(item->IDFile) > 2) {
|
||||
if (!equipment_material && strlen(item->IDFile) > 2 && Strings::IsNumber(&item->IDFile[2])) {
|
||||
equipment_material = std::stoi(&item->IDFile[2]);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user