Changeset 4910 in orxonox.OLD for orxonox/trunk/src/world_entities/weapons/weapon.cc
- Timestamp:
- Jul 20, 2005, 11:26:16 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/weapons/weapon.cc
r4906 r4910 266 266 // setting up for next action 267 267 this->currentState = WS_ACTIVATING; 268 this->stateDuration = this->times[W A_ACTIVATE] + this->stateDuration;268 this->stateDuration = this->times[WS_ACTIVATING] + this->stateDuration; 269 269 } 270 270 this->requestedAction = WA_NONE; … … 290 290 // setting up for next action 291 291 this->currentState = WS_DEACTIVATING; 292 this->stateDuration = this->times[W A_DEACTIVATE] + this->stateDuration;292 this->stateDuration = this->times[WS_DEACTIVATING] + this->stateDuration; 293 293 } 294 294 this->requestedAction = WA_NONE; … … 314 314 this->requestedAction = WA_NONE; 315 315 this->currentState = WS_CHARGING; 316 this->stateDuration = this->times[W A_CHARGE] + this->stateDuration;316 this->stateDuration = this->times[WS_CHARGING] + this->stateDuration; 317 317 } 318 318 else // deactivate the Weapon if we do not have enough energy … … 342 342 this->energyLoaded -= this->minCharge; 343 343 // setting up for the next state 344 this->stateDuration = this->times[W A_SHOOT] + this->stateDuration;344 this->stateDuration = this->times[WS_SHOOTING] + this->stateDuration; 345 345 this->currentState = WS_SHOOTING; 346 346 this->requestedAction = WA_NONE; … … 390 390 this->requestedAction = WA_NONE; 391 391 this->currentState = WS_RELOADING; 392 this->stateDuration = this->times[W A_RELOAD] + this->stateDuration;392 this->stateDuration = this->times[WS_RELOADING] + this->stateDuration; 393 393 394 394 } … … 400 400 void Weapon::tickW(float dt) 401 401 { 402 printf("%s ", stateToChar(this->currentState)); 403 402 404 // setting up the timing properties 403 405 this->stateDuration -= dt; … … 407 409 if (this->stateDuration <= 0.0) 408 410 { 409 if (unlikely (this->currentState != WS_DEACTIVATING)) 411 if (unlikely (this->currentState == WS_DEACTIVATING)) 412 { 413 this->currentState = WS_INACTIVE; 414 return; 415 } 416 else 410 417 this->currentState = WS_IDLE; 411 else412 this->currentState = WS_INACTIVE;413 418 414 419 if (this->requestedAction != WA_NONE)
Note: See TracChangeset
for help on using the changeset viewer.