Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/racetrack.cc22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/game/racetrack.cc b/src/game/racetrack.cc
index 31e5b40..897a839 100644
--- a/src/game/racetrack.cc
+++ b/src/game/racetrack.cc
@@ -61,8 +61,7 @@ void RaceTrack::reset()
track_checkpointtime = 0;
for (CheckPoints::iterator cpit = track_checkpoints.begin(); cpit != track_checkpoints.end(); ++cpit) {
- (*cpit)->entity_eventstate |= core::Entity::NoPower;
- (*cpit)->entity_dirty = true;
+ (*cpit)->set_eventstate(core::Entity::NoPower);
}
entity_eventstate |= core::Entity::NoPower;
@@ -83,12 +82,10 @@ void RaceTrack::frame(float seconds)
track_player = (*it);
track_racestart = core::server()->time();
- entity_eventstate &= (~core::Entity::NoPower);
- entity_dirty = true;
+ set_eventstate(core::Entity::Normal);
for (CheckPoints::iterator cpit = track_checkpoints.begin(); cpit != track_checkpoints.end(); ++cpit) {
- (*cpit)->entity_eventstate &= (~core::Entity::NoPower);
- (*cpit)->entity_dirty = true;
+ set_eventstate(core::Entity::Normal);
}
entity_timer = 5.0f;
@@ -143,8 +140,7 @@ void RaceTrack::frame(float seconds)
track_racestart = core::server()->time();
} else {
for (CheckPoints::iterator cpit = track_checkpoints.begin(); cpit != track_checkpoints.end(); ++cpit) {
- (*cpit)->entity_eventstate |= core::Entity::NoPower;
- (*cpit)->entity_dirty = true;
+ (*cpit)->set_eventstate(core::Entity::NoPower);
}
std::string message("^BGo!");
core::server()->broadcast(message);
@@ -152,8 +148,7 @@ void RaceTrack::frame(float seconds)
track_racestart = core::server()->time();
track_checkpointtime = core::server()->time() + 15.0f;
track_checkpoint = track_checkpoints.begin();
- (*track_checkpoint)->entity_eventstate &= ~core::Entity::NoPower;
- (*track_checkpoint)->entity_dirty = true;
+ (*track_checkpoint)->set_eventstate(core::Entity::Normal);
}
}
@@ -177,13 +172,12 @@ void RaceTrack::frame(float seconds)
std::string message("^BCheckpoint!");
core::server()->broadcast(message);
track_checkpointtime = core::server()->time() + 15.0f;
- (*track_checkpoint)->entity_eventstate |= core::Entity::NoPower;
- (*track_checkpoint)->entity_dirty = true;
+ (*track_checkpoint)->set_eventstate(core::Entity::NoPower);
track_checkpoint++;
- (*track_checkpoint)->entity_eventstate &= ~core::Entity::NoPower;
- (*track_checkpoint)->entity_dirty = true;
+ (*track_checkpoint)->set_eventstate(core::Entity::Normal);
} else {
+
std::stringstream msgstr;
msgstr << "^BRace completed in " << core::server()->time() - track_racestart << " seconds!";
core::server()->broadcast(msgstr.str());