Core: Fix creature_respawn handling in Outdoor PvP system, thanks to sombre for noticing

Closes issue 4971.

--HG--
branch : trunk
This commit is contained in:
click
2010-11-30 00:18:17 +01:00
parent 3cb4a52d59
commit e308d5cb44
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -48,10 +48,12 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team)
{ {
channel_id = 0; channel_id = 0;
m_flags |= CHANNEL_FLAG_CUSTOM; m_flags |= CHANNEL_FLAG_CUSTOM;
//load not built in channel if saved //load not built in channel if saved
std::string _name(name); std::string _name(name);
CharacterDatabase.escape_string(_name); CharacterDatabase.escape_string(_name);
QueryResult result = CharacterDatabase.PQuery("SELECT m_announce, m_moderate, m_public, m_password, BannedList FROM channels WHERE m_name = '%s' AND m_team = '%u'", _name.c_str(), m_Team); QueryResult result = CharacterDatabase.PQuery("SELECT m_announce, m_moderate, m_public, m_password, BannedList FROM channels WHERE m_name = '%s' AND m_team = '%u'", _name.c_str(), m_Team);
if (result)//load if (result)//load
{ {
Field *fields = result->Fetch(); Field *fields = result->Fetch();
@@ -187,7 +189,7 @@ void Channel::Join(uint64 p, const char *pass)
JoinNotify(p); JoinNotify(p);
// if no owner first logged will become // if no owner first logged will become
if (!IsConstant() && !m_ownerGUID) if (!m_public || (!IsConstant() && !m_ownerGUID))
{ {
SetOwner(p, (players.size() > 1 ? true : false)); SetOwner(p, (players.size() > 1 ? true : false));
players[p].SetModerator(true); players[p].SetModerator(true);
+1 -1
View File
@@ -166,7 +166,7 @@ bool OPvPCapturePoint::DelCreature(uint32 type)
//if (Map * map = sMapMgr.FindMap(cr->GetMapId())) //if (Map * map = sMapMgr.FindMap(cr->GetMapId()))
// map->Remove(cr,false); // map->Remove(cr,false);
// delete respawn time for this creature // delete respawn time for this creature
WorldDatabase.PExecute("DELETE FROM creature_respawn WHERE guid = '%u'", guid); CharacterDatabase.PExecute("DELETE FROM creature_respawn WHERE guid = '%u'", guid);
cr->AddObjectToRemoveList(); cr->AddObjectToRemoveList();
sObjectMgr.DeleteCreatureData(guid); sObjectMgr.DeleteCreatureData(guid);
m_CreatureTypes[m_Creatures[type]] = 0; m_CreatureTypes[m_Creatures[type]] = 0;