mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-27 08:17:16 +00:00
Added sanity fixes for testing
This commit is contained in:
@@ -188,8 +188,10 @@ Client::Client(EQStreamInterface* ieqs)
|
|||||||
berserk = false;
|
berserk = false;
|
||||||
dead = false;
|
dead = false;
|
||||||
eqs = ieqs;
|
eqs = ieqs;
|
||||||
|
if (eqs) {
|
||||||
ip = eqs->GetRemoteIP();
|
ip = eqs->GetRemoteIP();
|
||||||
port = ntohs(eqs->GetRemotePort());
|
port = ntohs(eqs->GetRemotePort());
|
||||||
|
}
|
||||||
client_state = CLIENT_CONNECTING;
|
client_state = CLIENT_CONNECTING;
|
||||||
Trader=false;
|
Trader=false;
|
||||||
Buyer = false;
|
Buyer = false;
|
||||||
|
|||||||
@@ -4295,6 +4295,12 @@ void Mob::TriggerDefensiveProcs(Mob *on, uint16 hand, bool FromSkillProc, int da
|
|||||||
if (!on) {
|
if (!on) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (on->GetHP() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (on->HasDied()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!FromSkillProc) {
|
if (!FromSkillProc) {
|
||||||
on->TryDefensiveProc(this, hand);
|
on->TryDefensiveProc(this, hand);
|
||||||
|
|||||||
@@ -234,6 +234,9 @@ bool NpcScaleManager::LoadScaleData()
|
|||||||
*/
|
*/
|
||||||
NpcScaleManager::global_npc_scale NpcScaleManager::GetGlobalScaleDataForTypeLevel(int8 npc_type, int npc_level)
|
NpcScaleManager::global_npc_scale NpcScaleManager::GetGlobalScaleDataForTypeLevel(int8 npc_type, int npc_level)
|
||||||
{
|
{
|
||||||
|
if (npc_type < 1) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
auto iter = npc_global_base_scaling_data.find(std::make_pair(npc_type, npc_level));
|
auto iter = npc_global_base_scaling_data.find(std::make_pair(npc_type, npc_level));
|
||||||
if (iter != npc_global_base_scaling_data.end()) {
|
if (iter != npc_global_base_scaling_data.end()) {
|
||||||
return iter->second;
|
return iter->second;
|
||||||
|
|||||||
@@ -471,6 +471,9 @@ int QuestParserCollection::EventEncounter(QuestEventID evt, std::string encounte
|
|||||||
}
|
}
|
||||||
|
|
||||||
QuestInterface *QuestParserCollection::GetQIByNPCQuest(uint32 npcid, std::string &filename) {
|
QuestInterface *QuestParserCollection::GetQIByNPCQuest(uint32 npcid, std::string &filename) {
|
||||||
|
if (!Config) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
//first look for /quests/zone/npcid.ext (precedence)
|
//first look for /quests/zone/npcid.ext (precedence)
|
||||||
filename = Config->QuestDir;
|
filename = Config->QuestDir;
|
||||||
filename += zone->GetShortName();
|
filename += zone->GetShortName();
|
||||||
@@ -699,6 +702,9 @@ QuestInterface *QuestParserCollection::GetQIByPlayerQuest(std::string &filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QuestInterface *QuestParserCollection::GetQIByGlobalNPCQuest(std::string &filename) {
|
QuestInterface *QuestParserCollection::GetQIByGlobalNPCQuest(std::string &filename) {
|
||||||
|
if (!Config) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
// simply look for /quests/global/global_npc.ext
|
// simply look for /quests/global/global_npc.ext
|
||||||
filename = Config->QuestDir;
|
filename = Config->QuestDir;
|
||||||
filename += QUEST_GLOBAL_DIRECTORY;
|
filename += QUEST_GLOBAL_DIRECTORY;
|
||||||
@@ -1003,6 +1009,7 @@ void QuestParserCollection::GetErrors(std::list<std::string> &err) {
|
|||||||
int QuestParserCollection::DispatchEventNPC(QuestEventID evt, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
int QuestParserCollection::DispatchEventNPC(QuestEventID evt, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||||
std::vector<EQ::Any> *extra_pointers) {
|
std::vector<EQ::Any> *extra_pointers) {
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
if (_load_precedence.size() == 0) return ret;
|
||||||
auto iter = _load_precedence.begin();
|
auto iter = _load_precedence.begin();
|
||||||
while(iter != _load_precedence.end()) {
|
while(iter != _load_precedence.end()) {
|
||||||
int i = (*iter)->DispatchEventNPC(evt, npc, init, data, extra_data, extra_pointers);
|
int i = (*iter)->DispatchEventNPC(evt, npc, init, data, extra_data, extra_pointers);
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ TaskProximityManager::~TaskProximityManager()
|
|||||||
|
|
||||||
bool TaskProximityManager::LoadProximities(int zone_id)
|
bool TaskProximityManager::LoadProximities(int zone_id)
|
||||||
{
|
{
|
||||||
|
if (zone_id == -1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
TaskProximity proximity{};
|
TaskProximity proximity{};
|
||||||
m_task_proximities.clear();
|
m_task_proximities.clear();
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -965,7 +965,9 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name)
|
|||||||
merchantvar = 0;
|
merchantvar = 0;
|
||||||
tradevar = 0;
|
tradevar = 0;
|
||||||
lootvar = 0;
|
lootvar = 0;
|
||||||
|
if (zoneid == -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if(RuleB(TaskSystem, EnableTaskSystem)) {
|
if(RuleB(TaskSystem, EnableTaskSystem)) {
|
||||||
task_manager->LoadProximities(zoneid);
|
task_manager->LoadProximities(zoneid);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user