Changeset 9 for trunk/src/game/MovementHandler.cpp
- Timestamp:
- 11/19/08 13:22:41 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/MovementHandler.cpp
r2 r9 131 131 132 132 // battleground state preper 133 if(_player->InBattleGround()) 133 // only add to bg group and object, if the player was invited (else he entered through command) 134 if(_player->InBattleGround() && _player->IsInvitedForBattleGroundInstance(_player->GetBattleGroundId())) 134 135 { 135 136 BattleGround *bg = _player->GetBattleGround(); 136 137 if(bg) 137 138 { 139 bg->AddPlayer(_player); 138 140 if(bg->GetMapId() == _player->GetMapId()) // we teleported to bg 139 141 { 140 if(!bg->GetBgRaid(_player->GetTeam())) // first player joined 142 // get the team this way, because arenas might 'override' the teams. 143 uint32 team = bg->GetPlayerTeam(_player->GetGUID()); 144 if(!team) 145 team = _player->GetTeam(); 146 if(!bg->GetBgRaid(team)) // first player joined 141 147 { 142 148 Group *group = new Group; 143 bg->SetBgRaid( _player->GetTeam(), group);149 bg->SetBgRaid(team, group); 144 150 group->Create(_player->GetGUIDLow(), _player->GetName()); 145 151 } 146 152 else // raid already exist 147 153 { 148 bg->GetBgRaid( _player->GetTeam())->AddMember(_player->GetGUID(), _player->GetName());154 bg->GetBgRaid(team)->AddMember(_player->GetGUID(), _player->GetName()); 149 155 } 150 156 } … … 366 372 if(movementInfo.z < -500.0f) 367 373 { 368 // NOTE: this is actually called many times while falling 369 // even after the player has been teleported away 370 // TODO: discard movement packets after the player is rooted 371 if(GetPlayer()->isAlive()) 372 { 373 GetPlayer()->EnvironmentalDamage(GetPlayer()->GetGUID(),DAMAGE_FALL_TO_VOID, GetPlayer()->GetMaxHealth()); 374 // change the death state to CORPSE to prevent the death timer from 375 // starting in the next player update 376 GetPlayer()->KillPlayer(); 377 GetPlayer()->BuildPlayerRepop(); 378 } 379 380 // cancel the death timer here if started 381 GetPlayer()->RepopAtGraveyard(); 374 if(GetPlayer()->InBattleGround() 375 && GetPlayer()->GetBattleGround() 376 && GetPlayer()->GetBattleGround()->HandlePlayerUnderMap(_player)) 377 { 378 // do nothing, the handle already did if returned true 379 } 380 else 381 { 382 // NOTE: this is actually called many times while falling 383 // even after the player has been teleported away 384 // TODO: discard movement packets after the player is rooted 385 if(GetPlayer()->isAlive()) 386 { 387 GetPlayer()->EnvironmentalDamage(GetPlayer()->GetGUID(),DAMAGE_FALL_TO_VOID, GetPlayer()->GetMaxHealth()); 388 // change the death state to CORPSE to prevent the death timer from 389 // starting in the next player update 390 GetPlayer()->KillPlayer(); 391 GetPlayer()->BuildPlayerRepop(); 392 } 393 394 // cancel the death timer here if started 395 GetPlayer()->RepopAtGraveyard(); 396 } 382 397 } 383 398 }