watereffects in right place for big units

This commit is contained in:
Titus Tscharntke 2010-05-07 08:01:14 +00:00
parent f192b33153
commit 54bcbf4303

View File

@ -332,9 +332,10 @@ void World::moveUnitCells(Unit *unit){
//water splash
if(tileset.getWaterEffects() && unit->getCurrField()==fLand){
if(map.getSubmerged(map.getCell(unit->getLastPos()))){
int unitSize=unit->getType()->getSize();
for(int i=0; i<3; ++i){
waterEffects.addWaterSplash(
Vec2f(unit->getLastPos().x+random.randRange(-0.4f, 0.4f), unit->getLastPos().y+random.randRange(-0.4f, 0.4f)), unit->getType()->getSize());
Vec2f(unit->getLastPos().x+(float)unitSize/2.0f+random.randRange(-0.9f, -0.1f), unit->getLastPos().y+random.randRange(-0.9f, -0.1f)+(float)unitSize/2.0f), unit->getType()->getSize());
}
}
}