Tested with Celatids for the first time and in some occassions got my infinite loop due to giving invalid commands-issue back.
The validity-check for weapons with arcing-shot is apparently way more complicated than for throwing since...
if (_action.type == BA_THROW)
{
targets.push_back(targetVoxel);
}
else
{
BattleUnit *tu = targetTile->getOverlappingUnit(_save);
if (Options::forceFire && _save->isCtrlPressed(true) && _save->getSide() == FACTION_PLAYER)
{
targets.push_back(_action.target.toVoxel() + Position(0, 0, 12));
forced = true;
}
else if (tu && ((_action.actor->getFaction() != FACTION_PLAYER) ||
tu->getVisible()))
{ //unit
targetVoxel.z += tu->getFloatHeight(); //ground level is the base
targets.push_back(targetVoxel + Position(0, 0, tu->getHeight()/2 + 1));
targets.push_back(targetVoxel + Position(0, 0, 2));
targets.push_back(targetVoxel + Position(0, 0, tu->getHeight() - 1));
}
else if (targetTile->getMapData(O_OBJECT) != 0)
{
targetVoxel = _action.target.toVoxel() + Position(8,8,0);
targets.push_back(targetVoxel + Position(0, 0, 13));
targets.push_back(targetVoxel + Position(0, 0, 8));
targets.push_back(targetVoxel + Position(0, 0, 23));
targets.push_back(targetVoxel + Position(0, 0, 2));
}
else if (targetTile->getMapData(O_NORTHWALL) != 0)
{
targetVoxel = _action.target.toVoxel() + Position(8,0,0);
targets.push_back(targetVoxel + Position(0, 0, 13));
targets.push_back(targetVoxel + Position(0, 0, 8));
targets.push_back(targetVoxel + Position(0, 0, 20));
targets.push_back(targetVoxel + Position(0, 0, 3));
}
else if (targetTile->getMapData(O_WESTWALL) != 0)
{
targetVoxel = _action.target.toVoxel() + Position(0,8,0);
targets.push_back(targetVoxel + Position(0, 0, 13));
targets.push_back(targetVoxel + Position(0, 0, 8));
targets.push_back(targetVoxel + Position(0, 0, 20));
targets.push_back(targetVoxel + Position(0, 0, 2));
}
else if (targetTile->getMapData(O_FLOOR) != 0)
{
targets.push_back(targetVoxel);
}
}
So instead of checking one target-voxel a whole bunch is beeing checked. But they are all different from the one being checked for an actual throw. So the same code cannot be used for throwing and arcing-shots.