- bugfix on new cellmap pos, need to check first if unit has a cellmap
This commit is contained in:
parent
f71f83d2b8
commit
9def99c8f5
|
@ -617,17 +617,18 @@ Vec2i UnitType::getFirstOccupiedCellInCellMap(Vec2i currentPos) const {
|
||||||
//printf("\n\n\n\n^^^^^^^^^^ currentPos [%s] size [%d]\n",currentPos.getString().c_str(),size);
|
//printf("\n\n\n\n^^^^^^^^^^ currentPos [%s] size [%d]\n",currentPos.getString().c_str(),size);
|
||||||
|
|
||||||
//checkItemInVault(&(this->size),this->size);
|
//checkItemInVault(&(this->size),this->size);
|
||||||
for(int i = 0; i < size; ++i) {
|
if(hasCellMap() == true) {
|
||||||
for(int j = 0; j < size; ++j){
|
for(int i = 0; i < size; ++i) {
|
||||||
if(cellMap[i*size+j] == true) {
|
for(int j = 0; j < size; ++j){
|
||||||
cell.x += i;
|
if(cellMap[i*size+j] == true) {
|
||||||
cell.y += j;
|
cell.x += i;
|
||||||
//printf("\n^^^^^^^^^^ cell [%s] i [%d] j [%d]\n",cell.getString().c_str(),i,j);
|
cell.y += j;
|
||||||
return cell;
|
//printf("\n^^^^^^^^^^ cell [%s] i [%d] j [%d]\n",cell.getString().c_str(),i,j);
|
||||||
|
return cell;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return cell;
|
return cell;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue