September 16th patch update

DLL version incremented
Beacon functionality added
Support for loading screen match preview display
Placeholder handling of new key-bindable mod commands
This commit is contained in:
PG-SteveT 2020-09-16 10:03:04 -07:00
parent e37e174be1
commit fd05be35c1
68 changed files with 1313 additions and 267 deletions

View file

@ -946,8 +946,12 @@ void FootClass::Approach_Target(void)
/*
** If a suitable intermediate location was found, then head toward it.
** Otherwise, head toward the enemy unit directly.
** Infantry always head towards the target since they can enter a cell
** in range, but still not be able to hit the target if the spot is out of range.
*/
if (found) {
if (What_Am_I() == RTTI_INFANTRY) {
Assign_Destination(TarCom);
} else if (found) {
Assign_Destination(::As_Target(trycell));
} else {
@ -1005,6 +1009,20 @@ int FootClass::Mission_Guard_Area(void)
ArchiveTarget = ::As_Target(Coord);
}
/*
** Ensure units aren't trying to guard cells off the map.
*/
if (Target_Legal(NavCom) && Is_Target_Cell(NavCom)) {
CELL cell = As_Cell(NavCom);
int x = Cell_X(cell);
int y = Cell_Y(cell);
if (x < Map.MapCellX || y < Map.MapCellY || x >= (Map.MapCellX + Map.MapCellWidth) || y >= (Map.MapCellY + Map.MapCellHeight)) {
Assign_Target(TARGET_NONE);
Assign_Destination(TARGET_NONE);
ArchiveTarget = ::As_Target(Coord);
}
}
/*
** If this is a bomber type infantry and the current target is a building, then go into
** sabotage mode if not already.
@ -1311,7 +1329,7 @@ void FootClass::Active_Click_With(ActionType action, CELL cell)
case ACTION_MOVE:
if (AllowVoice) {
COORDINATE coord = Map.Pixel_To_Coord(Get_Mouse_X(), Get_Mouse_Y());
OutList.Add(EventClass(ANIM_MOVE_FLASH, PlayerPtr->Class->House, coord));
OutList.Add(EventClass(ANIM_MOVE_FLASH, PlayerPtr->Class->House, coord, 1 << PlayerPtr->Class->House));
}
// Fall into next case.