Skip to content

Commit

Permalink
Revert "Fix #4888"
Browse files Browse the repository at this point in the history
This reverts commit 2f1d3eb.
  • Loading branch information
ashdnazg committed Jul 7, 2015
1 parent 1c0cf0a commit 6c36d0b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 24 deletions.
20 changes: 3 additions & 17 deletions rts/Sim/Projectiles/ProjectileHandler.cpp
Expand Up @@ -261,26 +261,12 @@ static void UPDATE_CONTAINER(T& cont) {
assert(cont.empty() || &(*cont.begin()) == origStart);
}

void CProjectileHandler::InitNewProjectiles()
{
for (auto &p: newProjectiles) {
eventHandler.ProjectileCreated(p, p->GetAllyteamID());
}
newProjectiles.clear();
#if UNSYNCED_PROJ_NOEVENT
for (auto &p: newUnsyncedProjectiles) {
eventHandler.UnsyncedProjectileCreated(p);
}
newUnsyncedProjectiles.clear();
#endif
}

void CProjectileHandler::Update()
{
{
SCOPED_TIMER("ProjectileHandler::Update");

InitNewProjectiles();

// particles
CheckCollisions(); // before :Update() to check if the particles move into stuff
UpdateProjectileContainer(syncedProjectiles, true);
Expand Down Expand Up @@ -329,7 +315,7 @@ void CProjectileHandler::AddProjectile(CProjectile* p)
} else {
unsyncedProjectiles.push_back(p);
#if UNSYNCED_PROJ_NOEVENT
newUnsyncedProjectiles.push_back(p);
eventHandler.UnsyncedProjectileCreated(p);
return;
#endif
freeIDs = &freeUnsyncedIDs;
Expand Down Expand Up @@ -366,7 +352,7 @@ void CProjectileHandler::AddProjectile(CProjectile* p)
#endif
}

newProjectiles.push_back(p);
eventHandler.ProjectileCreated(p, p->GetAllyteamID());
}


Expand Down
8 changes: 1 addition & 7 deletions rts/Sim/Projectiles/ProjectileHandler.h
Expand Up @@ -56,7 +56,7 @@ class CProjectileHandler

float GetParticleSaturation(const bool withRandomization = true) const;
int GetCurrentParticles() const;

void AddProjectile(CProjectile* p);
void AddGroundFlash(CGroundFlash* flash);
void AddFlyingPiece(const float3 pos, const float3 speed, int team, const S3DOPiece* piece, const S3DOPrimitive* chunk);
Expand All @@ -83,14 +83,8 @@ class CProjectileHandler
FlyingPieceContainer flyingPieces3DO; // unsynced
FlyingPieceContainer flyingPiecesS3O; // unsynced
GroundFlashContainer groundFlashes; // unsynced

ProjectileContainer newProjectiles; // projectiles that need projectileCreated to be called
#if UNSYNCED_PROJ_NOEVENT
ProjectileContainer newUnsyncedProjectiles; // projectiles that need UnsyncedProjectileCreated to be called
#endif

private:
void InitNewProjectiles();
void UpdateProjectileContainer(ProjectileContainer&, bool);

std::deque<int> freeSyncedIDs; // available synced (weapon, piece) projectile ID's
Expand Down

0 comments on commit 6c36d0b

Please sign in to comment.