- Timestamp:
- Jan 10, 2016, 1:54:11 PM (9 years ago)
- Location:
- code/branches/cpp11_v3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v3
- Property svn:mergeinfo changed
-
code/branches/cpp11_v3/src/modules/weapons/projectiles/GravityBombField.cc
r11052 r11054 125 125 126 126 //Check if any pawn is inside the shockwave and hit it with dammage proportional to the distance between explosion centre and pawn. Make sure, the same pawn is damaged only once. 127 for ( ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)127 for (Pawn* pawn : ObjectList<Pawn>()) 128 128 { 129 Vector3 distanceVector = it->getWorldPosition()-this->getWorldPosition();129 Vector3 distanceVector = pawn->getWorldPosition()-this->getWorldPosition(); 130 130 //orxout(debug_output) << "Found Pawn:" << it->getWorldPosition() << endl; 131 131 if(distanceVector.length()< forceSphereRadius_) 132 132 { 133 133 //orxout(debug_output) << "Force sphere radius is: " << forceSphereRadius_ << " Distance to Pawn is: " << distanceVector.length(); 134 if (std::find(victimsAlreadyDamaged_.begin(),victimsAlreadyDamaged_.end(), *it) == victimsAlreadyDamaged_.end())134 if (std::find(victimsAlreadyDamaged_.begin(),victimsAlreadyDamaged_.end(),pawn) == victimsAlreadyDamaged_.end()) 135 135 { 136 136 //orxout(debug_output) << "Found Pawn to damage: " << it->getWorldPosition() << endl; 137 137 float damage = FORCE_FIELD_EXPLOSION_DAMMAGE*(1-distanceVector.length()/EXPLOSION_RADIUS); 138 138 //orxout(debug_output) << "Damage: " << damage << endl; 139 it->hit(shooter_, it->getWorldPosition(), NULL, damage, 0,0);140 victimsAlreadyDamaged_.push_back( *it);139 pawn->hit(shooter_, pawn->getWorldPosition(), nullptr, damage, 0,0); 140 victimsAlreadyDamaged_.push_back(pawn); 141 141 } 142 142 }
Note: See TracChangeset
for help on using the changeset viewer.