- bugfix for scripted scenario function registerCellTriggerEventForFactionToLocation not working properly
This commit is contained in:
parent
cd321c0c77
commit
470fac5136
|
@ -322,7 +322,9 @@ void ScriptManager::onCellTriggerEvent(Unit *movingUnit) {
|
||||||
case ctet_FactionPos:
|
case ctet_FactionPos:
|
||||||
{
|
{
|
||||||
if(movingUnit->getFactionIndex() == event.sourceId) {
|
if(movingUnit->getFactionIndex() == event.sourceId) {
|
||||||
bool srcInDst = world->getMap()->isInUnitTypeCells(0, event.destPos,movingUnit->getPos());
|
//printf("ctet_FactionPos event.destPos = [%s], movingUnit->getPos() [%s]\n",event.destPos.getString().c_str(),movingUnit->getPos().getString().c_str());
|
||||||
|
|
||||||
|
bool srcInDst = world->getMap()->isInUnitTypeCells(movingUnit->getType(), event.destPos,movingUnit->getPos());
|
||||||
if(srcInDst == true) {
|
if(srcInDst == true) {
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugLUA).enabled) SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugLUA).enabled) SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
}
|
}
|
||||||
|
|
|
@ -195,7 +195,11 @@ Cell *Map::getCell(int x, int y) const {
|
||||||
|
|
||||||
Vec2i Map::getStartLocation(int locationIndex) const {
|
Vec2i Map::getStartLocation(int locationIndex) const {
|
||||||
if(locationIndex >= maxPlayers) {
|
if(locationIndex >= maxPlayers) {
|
||||||
throw runtime_error("locationIndex >= maxPlayers");
|
char szBuf[4096]="";
|
||||||
|
sprintf(szBuf,"locationIndex >= maxPlayers [%d] [%d]",locationIndex, maxPlayers);
|
||||||
|
printf("%s\n",szBuf);
|
||||||
|
//throw runtime_error(szBuf);
|
||||||
|
assert(locationIndex < maxPlayers);
|
||||||
}
|
}
|
||||||
else if(startLocations == NULL) {
|
else if(startLocations == NULL) {
|
||||||
throw runtime_error("startLocations == NULL");
|
throw runtime_error("startLocations == NULL");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user