EOSERV Bug Tracker > Bug #423: Prevent or create configurable default value for non existant NPC's

Bug #423: Prevent or create configurable default value for non existant NPC's

Prevent or create configurable default value for non existant NPC's
ID #423
Submitter insomniac
Product EOSERV
Severity Normal
Status OPEN, NEW
Submitted 26th Jul 2016
Updated 26th Jul 2016
insomniac Submitter 7 years, 40 weeks ago

"Not sure if this would be considered a bug or feature request so I placed it here under normal severity"

I'm not sure if this is a feature main had implemented but I think it would be decent to prevent or create configurable default value's for non existant NPC's. The only problem I have found from this issue is a client side glitch which basicly makes a map with an inrange non existant NPC unusable and kills the client.

I think adding the check in Map.cpp on line 603

if (!this->world->enf->Get(npc_id))

{

Console::Wrn("An NPC spawn on map %i uses a non-existent NPC (#%i at %ix%i)", this->id, npc_id, x, y);

//easiest way is to just skip the NPC.. continue;

//or short default_id = static_cast<int>(this->world->config["InvalidNPCID"])

if(default_id > 0)

{

if(this->world->enf->Get(default_id))

npc_id = default_id;

else

{

Console::Wrn("Default NPC spawn on map %i uses a non-existent NPC (#%i at %ix%i)", this->id, npc_id, x, y);

}

}

else

{

// whatever... continue;

}

}

Could possible do the same thing with chests.

Comments

Add Comment

Please don't post unless you have something relevant to the bug to say.
Do not comment to say "thanks" or "fix this please".

Please log in to add comments. EOSERV Bug Tracker > Bug #423: Prevent or create configurable default value for non existant NPC's