bugfix, so dragons can morph above water
This commit is contained in:
parent
af03402409
commit
b8010a18af
|
@ -564,9 +564,15 @@ bool Map::isFreeCell(const Vec2i &pos, Field field) const {
|
|||
|
||||
bool Map::isFreeCellOrHasUnit(const Vec2i &pos, Field field, const Unit *unit) const {
|
||||
if(isInside(pos) && isInsideSurface(toSurfCoords(pos))) {
|
||||
if(unit->getCurrField() != field) {
|
||||
return isFreeCell(pos, field);
|
||||
}
|
||||
Cell *c= getCell(pos);
|
||||
if(c->getUnit(unit->getCurrField()) == unit) {
|
||||
if(unit->getCurrField() == fAir) {
|
||||
if(field == fAir) {
|
||||
return true;
|
||||
}
|
||||
const SurfaceCell *sc= getSurfaceCell(toSurfCoords(pos));
|
||||
if(sc != NULL) {
|
||||
if(getDeepSubmerged(sc) == true) {
|
||||
|
|
|
@ -1820,7 +1820,7 @@ void UnitUpdater::updateMorph(Unit *unit, int frameIndex) {
|
|||
|
||||
if(unit->getCurrSkill()->getClass()!=scMorph){
|
||||
//if not morphing, check space
|
||||
if(map->isFreeCellsOrHasUnit(unit->getPos(), mct->getMorphUnit()->getSize(), unit->getCurrField(), unit, mct->getMorphUnit())){
|
||||
if(map->isFreeCellsOrHasUnit(unit->getPos(), mct->getMorphUnit()->getSize(), mct->getMorphUnit()->getField(), unit, mct->getMorphUnit())){
|
||||
unit->setCurrSkill(mct->getMorphSkillType());
|
||||
}
|
||||
else{
|
||||
|
|
Loading…
Reference in New Issue
Block a user