This commit is contained in:
Uleat 2015-01-10 14:31:18 -05:00
commit bbb3e1a1bd
6 changed files with 25 additions and 15 deletions

View File

@ -3261,7 +3261,8 @@ uint32 Database::GetGroupID(const char* name){
if (results.RowCount() == 0) if (results.RowCount() == 0)
{ {
LogFile->write(EQEmuLog::Debug, "Character not in a group: %s", name); // Commenting this out until logging levels can prevent this from going to console
//LogFile->write(EQEmuLog::Debug, "Character not in a group: %s", name);
return 0; return 0;
} }

View File

@ -1108,6 +1108,7 @@ int16 Inventory::_PutItem(int16 slot_id, ItemInst* inst)
} }
int16 result = INVALID_INDEX; int16 result = INVALID_INDEX;
int16 parentSlot = INVALID_INDEX;
if (slot_id == MainCursor) { if (slot_id == MainCursor) {
// Replace current item on cursor, if exists // Replace current item on cursor, if exists
@ -1142,16 +1143,17 @@ int16 Inventory::_PutItem(int16 slot_id, ItemInst* inst)
else else
{ {
// Slot must be within a bag // Slot must be within a bag
ItemInst* baginst = GetItem(Inventory::CalcSlotId(slot_id)); // Get parent bag parentSlot = Inventory::CalcSlotId(slot_id);
ItemInst* baginst = GetItem(parentSlot); // Get parent bag
if (baginst && baginst->IsType(ItemClassContainer)) if (baginst && baginst->IsType(ItemClassContainer))
{ {
baginst->_PutItem(Inventory::CalcBagIdx(slot_id), inst); baginst->_PutItem(Inventory::CalcBagIdx(slot_id), inst);
result = slot_id; result = slot_id;
} }
} }
if (result == INVALID_INDEX) { if (result == INVALID_INDEX) {
LogFile->write(EQEmuLog::Error, "Inventory::_PutItem: Invalid slot_id specified (%i)", slot_id); LogFile->write(EQEmuLog::Error, "Inventory::_PutItem: Invalid slot_id specified (%i) with parent slot id (%i)", slot_id, parentSlot);
Inventory::MarkDirty(inst); // Slot not found, clean up Inventory::MarkDirty(inst); // Slot not found, clean up
} }

View File

@ -4668,3 +4668,10 @@ Mob *EntityList::GetTargetForVirus(Mob *spreader, int range)
return TargetsInRange[zone->random.Int(0, TargetsInRange.size() - 1)]; return TargetsInRange[zone->random.Int(0, TargetsInRange.size() - 1)];
} }
void EntityList::StopMobAI()
{
for (auto &mob : mob_list) {
mob.second->AI_Stop();
mob.second->AI_ShutDown();
}
}

View File

@ -268,6 +268,8 @@ public:
Entity *GetEntityMob(const char *name); Entity *GetEntityMob(const char *name);
Entity *GetEntityCorpse(const char *name); Entity *GetEntityCorpse(const char *name);
void StopMobAI();
void DescribeAggro(Client *towho, NPC *from_who, float dist, bool verbose); void DescribeAggro(Client *towho, NPC *from_who, float dist, bool verbose);
void Message(uint32 to_guilddbid, uint32 type, const char* message, ...); void Message(uint32 to_guilddbid, uint32 type, const char* message, ...);

View File

@ -1101,8 +1101,14 @@ void Mob::ProjectileAttack()
if (target){ if (target){
if (IsNPC()) if (IsNPC()){
CastToNPC()->DoRangedAttackDmg(target, false, ProjectileAtk[i].wpn_dmg,0, static_cast<SkillUseTypes>(ProjectileAtk[i].skill)); if (ProjectileAtk[i].skill == SkillConjuration){
if (IsValidSpell(ProjectileAtk[i].wpn_dmg))
SpellOnTarget(ProjectileAtk[i].wpn_dmg, target, false, true, spells[ProjectileAtk[i].wpn_dmg].ResistDiff, true);
}
else
CastToNPC()->DoRangedAttackDmg(target, false, ProjectileAtk[i].wpn_dmg,0, static_cast<SkillUseTypes>(ProjectileAtk[i].skill));
}
else else
{ {

View File

@ -662,15 +662,7 @@ void Zone::Shutdown(bool quite)
if (!ZoneLoaded) if (!ZoneLoaded)
return; return;
std::list<Mob*> mob_list; entity_list.StopMobAI();
entity_list.GetMobList(mob_list);
std::list<Mob*>::iterator mob_itr = mob_list.begin();
while (mob_itr != mob_list.end()) {
Mob* mob_inst = *mob_itr;
mob_inst->AI_Stop();
mob_inst->AI_ShutDown();
++mob_itr;
}
std::map<uint32,NPCType *>::iterator itr; std::map<uint32,NPCType *>::iterator itr;
while(zone->npctable.size()) { while(zone->npctable.size()) {