- Timestamp:
- 11/22/08 16:14:42 (17 years ago)
- Location:
- trunk/src/game
- Files:
-
- 5 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/ObjectMgr.cpp
r279 r290 45 45 #include "SpellAuras.h" 46 46 #include "Util.h" 47 #include "WaypointManager.h" 47 48 48 49 INSTANTIATE_SINGLETON_1(ObjectMgr); … … 7472 7473 CheckScripts(sEventScripts,ids); 7473 7474 7475 WaypointMgr.CheckTextsExistance(ids); 7476 7474 7477 for(std::set<int32>::const_iterator itr = ids.begin(); itr != ids.end(); ++itr) 7475 7478 sLog.outErrorDb( "Table `db_script_string` has unused string id %u", *itr); -
trunk/src/game/Player.cpp
r284 r290 1017 1017 CheckExploreSystem(); 1018 1018 1019 /*if(isCharmed()) 1020 { 1021 if(Unit *charmer = GetCharmer()) 1022 if(charmer->GetTypeId() == TYPEID_UNIT && ((Creature*)charmer)->AI()) 1023 ((Creature*)charmer)->AI()->UpdateCharmedAI(this, p_time); 1024 }*/ 1025 1019 1026 // Update items that have just a limited lifetime 1020 1027 if (now>m_Last_tick) … … 5267 5274 y = GetPositionY(); 5268 5275 z = GetPositionZ(); 5276 5277 // group update 5278 if(GetGroup() && (old_x != x || old_y != y)) 5279 SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POSITION); 5269 5280 } 5270 5281 … … 5273 5284 5274 5285 CheckExploreSystem(); 5275 5276 // group update5277 if(GetGroup())5278 SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POSITION);5279 5286 5280 5287 return true; -
trunk/src/game/Unit.cpp
r288 r290 9623 9623 void Unit::SetPower(Powers power, uint32 val) 9624 9624 { 9625 if(GetPower(power) == val) 9626 return; 9627 9625 9628 uint32 maxPower = GetMaxPower(power); 9626 9629 if(maxPower < val) -
trunk/src/game/WaypointManager.cpp
r279 r290 125 125 be.spell = fields[8].GetUInt32(); 126 126 127 // load and store without holes in array128 int j = 0;129 127 for(int i = 0; i < MAX_WAYPOINT_TEXT; ++i) 130 128 { 131 be.textid[ j] = fields[9+i].GetUInt32();132 if(be.textid[ j])129 be.textid[i] = fields[9+i].GetUInt32(); 130 if(be.textid[i]) 133 131 { 134 if (be.textid[ j] < MIN_DB_SCRIPT_STRING_ID || be.textid[j] >= MAX_DB_SCRIPT_STRING_ID)132 if (be.textid[i] < MIN_DB_SCRIPT_STRING_ID || be.textid[i] >= MAX_DB_SCRIPT_STRING_ID) 135 133 { 136 sLog.outErrorDb( "Table `db_script_string` not have string id %u", be.textid[ j]);134 sLog.outErrorDb( "Table `db_script_string` not have string id %u", be.textid[i]); 137 135 continue; 138 136 } 139 140 if (!objmgr.GetTrinityStringLocale (be.textid[j]))141 {142 sLog.outErrorDb("ERROR: Waypoint path %d (point %d), have invalid text id (%i) in `textid%d, ignored.",143 id, point, be.textid[j], i+1);144 continue;145 }146 147 ++j; // to next internal field148 137 } 149 138 } 150 // fill array tail151 for(; j < MAX_WAYPOINT_TEXT; ++j)152 be.textid[j] = 0;153 139 154 140 // save memory by not storing empty behaviors … … 309 295 } 310 296 } 297 298 void WaypointManager::CheckTextsExistance(std::set<int32>& ids) 299 { 300 WaypointPathMap::iterator pmItr = m_pathMap.begin(); 301 for ( ; pmItr != m_pathMap.end(); ++pmItr) 302 { 303 for (int i = 0; i < pmItr->second.size(); ++i) 304 { 305 if (!pmItr->second[i].behavior) 306 continue; 307 308 // Now we check text existence and put all zero texts ids to the end of array 309 310 // Counting leading zeros for futher textid shift 311 int zeroCount = 0; 312 for (int j = 0; j < MAX_WAYPOINT_TEXT; ++j) 313 { 314 if (!pmItr->second[i].behavior->textid[j]) 315 { 316 ++zeroCount; 317 continue; 318 } 319 else 320 { 321 if (!objmgr.GetMangosStringLocale(pmItr->second[i].behavior->textid[j])) 322 { 323 sLog.outErrorDb("ERROR: Some waypoint has textid%u with not existing %u text.", j, pmItr->second[i].behavior->textid[j]); 324 pmItr->second[i].behavior->textid[j] = 0; 325 ++zeroCount; 326 continue; 327 } 328 else 329 ids.erase(pmItr->second[i].behavior->textid[j]); 330 331 // Shifting check 332 if (zeroCount) 333 { 334 // Correct textid but some zeros leading, so move it forward. 335 pmItr->second[i].behavior->textid[j-zeroCount] = pmItr->second[i].behavior->textid[j]; 336 pmItr->second[i].behavior->textid[j] = 0; 337 } 338 } 339 } 340 } 341 } 342 } -
trunk/src/game/WaypointManager.h
r279 r290 79 79 void SetNodePosition(uint32 id, uint32 point, float x, float y, float z); 80 80 void SetNodeText(uint32 id, uint32 point, const char *text_field, const char *text); 81 void CheckTextsExistance(std::set<int32>& ids); 81 82 82 83 private: