aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Scripting
diff options
context:
space:
mode:
authorBootz <Stage6Dev@EMPulseGaming.com>2011-10-07 19:45:43 -0500
committerBootz <Stage6Dev@EMPulseGaming.com>2011-10-07 19:45:43 -0500
commit5b4c7783c2a28e420cb4aaf4f2967083db8f6787 (patch)
tree887be454d8d9d1a916d8085a243a2afaff2c0dbe /src/server/game/Scripting
parentc89b1f6989ce1f5a48c48766993c3dd8101cc21b (diff)
REPO: Code-style clean-ups
* Fixed pMap->map * Fixed pInstance->instance * Fixed pInsta->instance * Fixed pQuest->quest * Fixed pWho->who * Fixed pTarget->target * Fixed pGo->go ~DEVNOTES: Handlers/QuestHandler.cpp still needs to be cleaned...
Diffstat (limited to 'src/server/game/Scripting')
-rwxr-xr-xsrc/server/game/Scripting/MapScripts.cpp34
-rwxr-xr-xsrc/server/game/Scripting/ScriptMgr.cpp20
-rwxr-xr-xsrc/server/game/Scripting/ScriptMgr.h2
-rwxr-xr-xsrc/server/game/Scripting/ScriptSystem.cpp76
4 files changed, 66 insertions, 66 deletions
diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp
index d33d338fe82..de5d24ee6b6 100755
--- a/src/server/game/Scripting/MapScripts.cpp
+++ b/src/server/game/Scripting/MapScripts.cpp
@@ -539,8 +539,8 @@ void Map::ScriptsProcess()
// when script called for item spell casting then target == (unit or GO) and source is player
WorldObject* worldObject;
- Player* pTarget = target->ToPlayer();
- if (pTarget)
+ Player* target = target->ToPlayer();
+ if (target)
{
if (source->GetTypeId() != TYPEID_UNIT && source->GetTypeId() != TYPEID_GAMEOBJECT && source->GetTypeId() != TYPEID_PLAYER)
{
@@ -552,8 +552,8 @@ void Map::ScriptsProcess()
}
else
{
- pTarget = source->ToPlayer();
- if (pTarget)
+ target = source->ToPlayer();
+ if (target)
{
if (target->GetTypeId() != TYPEID_UNIT && target->GetTypeId() != TYPEID_GAMEOBJECT && target->GetTypeId() != TYPEID_PLAYER)
{
@@ -575,10 +575,10 @@ void Map::ScriptsProcess()
// quest id and flags checked at script loading
if ((worldObject->GetTypeId() != TYPEID_UNIT || ((Unit*)worldObject)->isAlive()) &&
- (step.script->QuestExplored.Distance == 0 || worldObject->IsWithinDistInMap(pTarget, float(step.script->QuestExplored.Distance))))
- pTarget->AreaExploredOrEventHappens(step.script->QuestExplored.QuestID);
+ (step.script->QuestExplored.Distance == 0 || worldObject->IsWithinDistInMap(target, float(step.script->QuestExplored.Distance))))
+ target->AreaExploredOrEventHappens(step.script->QuestExplored.QuestID);
else
- pTarget->FailQuest(step.script->QuestExplored.QuestID);
+ target->FailQuest(step.script->QuestExplored.QuestID);
break;
}
@@ -686,8 +686,8 @@ void Map::ScriptsProcess()
{
// Source (datalong2 != 0) or target (datalong2 == 0) must be Unit.
bool bReverse = step.script->RemoveAura.Flags & SF_REMOVEAURA_REVERSE;
- if (Unit* pTarget = _GetScriptUnit(bReverse ? source : target, bReverse, step.script))
- pTarget->RemoveAurasDueToSpell(step.script->RemoveAura.SpellID);
+ if (Unit* target = _GetScriptUnit(bReverse ? source : target, bReverse, step.script))
+ target->RemoveAurasDueToSpell(step.script->RemoveAura.SpellID);
break;
}
@@ -751,20 +751,20 @@ void Map::ScriptsProcess()
if (WorldObject* pSource = _GetScriptWorldObject(source, true, step.script))
{
// PlaySound.Flags bitmask: 0/1=anyone/target
- Player* pTarget = NULL;
+ Player* target = NULL;
if (step.script->PlaySound.Flags & SF_PLAYSOUND_TARGET_PLAYER)
{
// Target must be Player.
- pTarget = _GetScriptPlayer(target, false, step.script);
- if (!pTarget)
+ target = _GetScriptPlayer(target, false, step.script);
+ if (!target)
break;
}
// PlaySound.Flags bitmask: 0/2=without/with distance dependent
if (step.script->PlaySound.Flags & SF_PLAYSOUND_DISTANCE_SOUND)
- pSource->PlayDistanceSound(step.script->PlaySound.SoundID, pTarget);
+ pSource->PlayDistanceSound(step.script->PlaySound.SoundID, target);
else
- pSource->PlayDirectSound(step.script->PlaySound.SoundID, pTarget);
+ pSource->PlayDirectSound(step.script->PlaySound.SoundID, target);
}
break;
@@ -878,11 +878,11 @@ void Map::ScriptsProcess()
if (step.script->Orientation.Flags& SF_ORIENTATION_FACE_TARGET)
{
// Target must be Unit.
- Unit* pTarget = _GetScriptUnit(target, false, step.script);
- if (!pTarget)
+ Unit* target = _GetScriptUnit(target, false, step.script);
+ if (!target)
break;
- pSource->SetInFront(pTarget);
+ pSource->SetInFront(target);
}
else
pSource->SetOrientation(step.script->Orientation.Orientation);
diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp
index d37938eba48..120227c172d 100755
--- a/src/server/game/Scripting/ScriptMgr.cpp
+++ b/src/server/game/Scripting/ScriptMgr.cpp
@@ -155,7 +155,7 @@ class ScriptRegistry
if (!V) \
return R;
-void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget)
+void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* target)
{
if (!pSource)
{
@@ -198,21 +198,21 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget)
switch (pData->uiType)
{
case CHAT_TYPE_SAY:
- pSource->MonsterSay(iTextEntry, pData->uiLanguage, pTarget ? pTarget->GetGUID() : 0);
+ pSource->MonsterSay(iTextEntry, pData->uiLanguage, target ? target->GetGUID() : 0);
break;
case CHAT_TYPE_YELL:
- pSource->MonsterYell(iTextEntry, pData->uiLanguage, pTarget ? pTarget->GetGUID() : 0);
+ pSource->MonsterYell(iTextEntry, pData->uiLanguage, target ? target->GetGUID() : 0);
break;
case CHAT_TYPE_TEXT_EMOTE:
- pSource->MonsterTextEmote(iTextEntry, pTarget ? pTarget->GetGUID() : 0);
+ pSource->MonsterTextEmote(iTextEntry, target ? target->GetGUID() : 0);
break;
case CHAT_TYPE_BOSS_EMOTE:
- pSource->MonsterTextEmote(iTextEntry, pTarget ? pTarget->GetGUID() : 0, true);
+ pSource->MonsterTextEmote(iTextEntry, target ? target->GetGUID() : 0, true);
break;
case CHAT_TYPE_WHISPER:
{
- if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
- pSource->MonsterWhisper(iTextEntry, pTarget->GetGUID());
+ if (target && target->GetTypeId() == TYPEID_PLAYER)
+ pSource->MonsterWhisper(iTextEntry, target->GetGUID());
else
sLog->outError("TSCR: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry);
@@ -220,15 +220,15 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget)
}
case CHAT_TYPE_BOSS_WHISPER:
{
- if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
- pSource->MonsterWhisper(iTextEntry, pTarget->GetGUID(), true);
+ if (target && target->GetTypeId() == TYPEID_PLAYER)
+ pSource->MonsterWhisper(iTextEntry, target->GetGUID(), true);
else
sLog->outError("TSCR: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry);
break;
}
case CHAT_TYPE_ZONE_YELL:
- pSource->MonsterYellToZone(iTextEntry, pData->uiLanguage, pTarget ? pTarget->GetGUID() : 0);
+ pSource->MonsterYellToZone(iTextEntry, pData->uiLanguage, target ? target->GetGUID() : 0);
break;
}
}
diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h
index 5925992a3c2..b3ba7f0a89c 100755
--- a/src/server/game/Scripting/ScriptMgr.h
+++ b/src/server/game/Scripting/ScriptMgr.h
@@ -69,7 +69,7 @@ struct OutdoorPvPData;
#define VISIBLE_RANGE 166.0f //MAX visible range (size of grid)
// Generic scripting text function.
-void DoScriptText(int32 textEntry, WorldObject* pSource, Unit* pTarget = NULL);
+void DoScriptText(int32 textEntry, WorldObject* pSource, Unit* target = NULL);
/*
TODO: Add more script type classes.
diff --git a/src/server/game/Scripting/ScriptSystem.cpp b/src/server/game/Scripting/ScriptSystem.cpp
index ef5a3b8184f..8c6f5626101 100755
--- a/src/server/game/Scripting/ScriptSystem.cpp
+++ b/src/server/game/Scripting/ScriptSystem.cpp
@@ -64,13 +64,13 @@ void SystemMgr::LoadScriptTexts()
do
{
Field* pFields = result->Fetch();
- StringTextData pTemp;
+ StringTextData temp;
int32 iId = pFields[0].GetInt32();
- pTemp.uiSoundId = pFields[1].GetUInt32();
- pTemp.uiType = pFields[2].GetUInt32();
- pTemp.uiLanguage = pFields[3].GetUInt32();
- pTemp.uiEmote = pFields[4].GetUInt32();
+ temp.uiSoundId = pFields[1].GetUInt32();
+ temp.uiType = pFields[2].GetUInt32();
+ temp.uiLanguage = pFields[3].GetUInt32();
+ temp.uiEmote = pFields[4].GetUInt32();
if (iId >= 0)
{
@@ -84,19 +84,19 @@ void SystemMgr::LoadScriptTexts()
continue;
}
- if (pTemp.uiSoundId)
+ if (temp.uiSoundId)
{
- if (!GetSoundEntriesStore()->LookupEntry(pTemp.uiSoundId))
- sLog->outErrorDb("TSCR: Entry %i in table `script_texts` has soundId %u but sound does not exist.", iId, pTemp.uiSoundId);
+ if (!GetSoundEntriesStore()->LookupEntry(temp.uiSoundId))
+ sLog->outErrorDb("TSCR: Entry %i in table `script_texts` has soundId %u but sound does not exist.", iId, temp.uiSoundId);
}
- if (!GetLanguageDescByID(pTemp.uiLanguage))
- sLog->outErrorDb("TSCR: Entry %i in table `script_texts` using Language %u but Language does not exist.", iId, pTemp.uiLanguage);
+ if (!GetLanguageDescByID(temp.uiLanguage))
+ sLog->outErrorDb("TSCR: Entry %i in table `script_texts` using Language %u but Language does not exist.", iId, temp.uiLanguage);
- if (pTemp.uiType > CHAT_TYPE_ZONE_YELL)
- sLog->outErrorDb("TSCR: Entry %i in table `script_texts` has Type %u but this Chat Type does not exist.", iId, pTemp.uiType);
+ if (temp.uiType > CHAT_TYPE_ZONE_YELL)
+ sLog->outErrorDb("TSCR: Entry %i in table `script_texts` has Type %u but this Chat Type does not exist.", iId, temp.uiType);
- m_mTextDataMap[iId] = pTemp;
+ m_mTextDataMap[iId] = temp;
++uiCount;
} while (result->NextRow());
@@ -125,13 +125,13 @@ void SystemMgr::LoadScriptTextsCustom()
do
{
Field* pFields = result->Fetch();
- StringTextData pTemp;
+ StringTextData temp;
int32 iId = pFields[0].GetInt32();
- pTemp.uiSoundId = pFields[1].GetUInt32();
- pTemp.uiType = pFields[2].GetUInt32();
- pTemp.uiLanguage = pFields[3].GetUInt32();
- pTemp.uiEmote = pFields[4].GetUInt32();
+ temp.uiSoundId = pFields[1].GetUInt32();
+ temp.uiType = pFields[2].GetUInt32();
+ temp.uiLanguage = pFields[3].GetUInt32();
+ temp.uiEmote = pFields[4].GetUInt32();
if (iId >= 0)
{
@@ -145,19 +145,19 @@ void SystemMgr::LoadScriptTextsCustom()
continue;
}
- if (pTemp.uiSoundId)
+ if (temp.uiSoundId)
{
- if (!GetSoundEntriesStore()->LookupEntry(pTemp.uiSoundId))
- sLog->outErrorDb("TSCR: Entry %i in table `custom_texts` has soundId %u but sound does not exist.", iId, pTemp.uiSoundId);
+ if (!GetSoundEntriesStore()->LookupEntry(temp.uiSoundId))
+ sLog->outErrorDb("TSCR: Entry %i in table `custom_texts` has soundId %u but sound does not exist.", iId, temp.uiSoundId);
}
- if (!GetLanguageDescByID(pTemp.uiLanguage))
- sLog->outErrorDb("TSCR: Entry %i in table `custom_texts` using Language %u but Language does not exist.", iId, pTemp.uiLanguage);
+ if (!GetLanguageDescByID(temp.uiLanguage))
+ sLog->outErrorDb("TSCR: Entry %i in table `custom_texts` using Language %u but Language does not exist.", iId, temp.uiLanguage);
- if (pTemp.uiType > CHAT_TYPE_ZONE_YELL)
- sLog->outErrorDb("TSCR: Entry %i in table `custom_texts` has Type %u but this Chat Type does not exist.", iId, pTemp.uiType);
+ if (temp.uiType > CHAT_TYPE_ZONE_YELL)
+ sLog->outErrorDb("TSCR: Entry %i in table `custom_texts` has Type %u but this Chat Type does not exist.", iId, temp.uiType);
- m_mTextDataMap[iId] = pTemp;
+ m_mTextDataMap[iId] = temp;
++uiCount;
} while (result->NextRow());
@@ -195,28 +195,28 @@ void SystemMgr::LoadScriptWaypoints()
do
{
Field* pFields = result->Fetch();
- ScriptPointMove pTemp;
+ ScriptPointMove temp;
- pTemp.uiCreatureEntry = pFields[0].GetUInt32();
- uint32 uiEntry = pTemp.uiCreatureEntry;
- pTemp.uiPointId = pFields[1].GetUInt32();
- pTemp.fX = pFields[2].GetFloat();
- pTemp.fY = pFields[3].GetFloat();
- pTemp.fZ = pFields[4].GetFloat();
- pTemp.uiWaitTime = pFields[5].GetUInt32();
+ temp.uiCreatureEntry = pFields[0].GetUInt32();
+ uint32 uiEntry = temp.uiCreatureEntry;
+ temp.uiPointId = pFields[1].GetUInt32();
+ temp.fX = pFields[2].GetFloat();
+ temp.fY = pFields[3].GetFloat();
+ temp.fZ = pFields[4].GetFloat();
+ temp.uiWaitTime = pFields[5].GetUInt32();
- CreatureTemplate const* pCInfo = sObjectMgr->GetCreatureTemplate(pTemp.uiCreatureEntry);
+ CreatureTemplate const* pCInfo = sObjectMgr->GetCreatureTemplate(temp.uiCreatureEntry);
if (!pCInfo)
{
- sLog->outErrorDb("TSCR: DB table script_waypoint has waypoint for non-existant creature entry %u", pTemp.uiCreatureEntry);
+ sLog->outErrorDb("TSCR: DB table script_waypoint has waypoint for non-existant creature entry %u", temp.uiCreatureEntry);
continue;
}
if (!pCInfo->ScriptID)
- sLog->outErrorDb("TSCR: DB table script_waypoint has waypoint for creature entry %u, but creature does not have ScriptName defined and then useless.", pTemp.uiCreatureEntry);
+ sLog->outErrorDb("TSCR: DB table script_waypoint has waypoint for creature entry %u, but creature does not have ScriptName defined and then useless.", temp.uiCreatureEntry);
- m_mPointMoveMap[uiEntry].push_back(pTemp);
+ m_mPointMoveMap[uiEntry].push_back(temp);
++count;
} while (result->NextRow());