Skip to content

Commit

Permalink
Fix AI not moving
Browse files Browse the repository at this point in the history
harmful chrysalis auto chainsaw
Change player templates file missing log to warning
  • Loading branch information
cxong committed Dec 31, 2023
1 parent d596d1d commit cc1b021
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion missions/harmful_crysalis.cdogscpn/guns.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"Sound": "",
"SwitchSound": "chainsaw_switch",
"SoundLockLength": 50,
"CanShoot": false
"CanShoot": false,
"Auto": true
},
{
"Pic": "blaster_white",
Expand Down
4 changes: 2 additions & 2 deletions src/cdogs/actors.c
Original file line number Diff line number Diff line change
Expand Up @@ -1130,13 +1130,13 @@ static bool ActorTryMove(TActor *actor, int cmd, int ticks)
actor->PlayerUID < 0 ? (actor->flags & FLAGS_MOVE_AND_SHOOT) :
(
ConfigGetEnum(&gConfig, "Game.FireMoveStyle") != FIREMOVE_STOP ||
!actor->hasShot ||
(ConfigGetEnum(&gConfig, "Game.SwitchMoveStyle") ==
SWITCHMOVE_STRAFE &&
Button2(cmd))
);
const bool canMove = !actor->hasShot || canMoveWhenShooting;
const bool willMove =
!actor->petrified && CMD_HAS_DIRECTION(cmd) && canMoveWhenShooting;
!actor->petrified && CMD_HAS_DIRECTION(cmd) && canMove;
actor->MoveVel = svec2_zero();
if (willMove)
{
Expand Down
2 changes: 1 addition & 1 deletion src/cdogs/player_template.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void PlayerTemplatesLoad(PlayerTemplates *pt, const CharacterClasses *classes)
FILE *f = fopen(GetConfigFilePath(PLAYER_TEMPLATE_FILE), "r");
if (!f)
{
LOG(LM_MAIN, LL_ERROR, "loading player templates '%s'",
LOG(LM_MAIN, LL_WARN, "player templates file missing '%s'",
PLAYER_TEMPLATE_FILE);
goto bail;
}
Expand Down

0 comments on commit cc1b021

Please sign in to comment.