Skip to content

Commit

Permalink
Fix co-op AI shooting with knife
Browse files Browse the repository at this point in the history
Fix black control text
Add pause to windows build scripts
  • Loading branch information
cxong committed Apr 15, 2015
1 parent b95dcbe commit a5d9a3f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions make.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
cmake -G "MinGW Makefiles" -D CMAKE_C_COMPILER=mingw32-gcc.exe -D CMAKE_MAKE_PROGRAM=mingw32-make.exe .
mingw32-make
pause
3 changes: 2 additions & 1 deletion make_package.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
cmake -G "MinGW Makefiles" -D CMAKE_C_COMPILER=mingw32-gcc.exe -D CMAKE_MAKE_PROGRAM=mingw32-make.exe .
mingw32-make
mingw32-make package
mingw32-make package
pause
5 changes: 3 additions & 2 deletions src/cdogs/ai_coop.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,11 @@ static int AICoopGetCmdNormal(TActor *actor)
}
// Move to the ideal distance for the weapon
int cmd = 0;
const int gunRange = GunGetRange(ActorGetGun(actor)->Gun);
const GunDescription *gun = ActorGetGun(actor)->Gun;
const int gunRange = GunGetRange(gun);
const int distanceSquared = DistanceSquared(
Vec2iFull2Real(actor->Pos), Vec2iFull2Real(closestEnemy->Pos));
const bool canFire = ActorGetGun(actor)->lock <= 0;
const bool canFire = gun->CanShoot && ActorGetGun(actor)->lock <= 0;
if ((double)distanceSquared >
SQUARED(gunRange * 3 / 4) * actor->aiContext->GunRangeScalar)
{
Expand Down
2 changes: 1 addition & 1 deletion src/cdogs/hud.c
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ void HUDDraw(HUD *hud, int isPaused)

pos.y += FontH();
pos = FontStr("Press ", pos);
color_t c;
color_t c = colorWhite;
const char *buttonName = InputGetButtonNameColor(0, CMD_ESC, &c);
pos = FontStrMask(buttonName, pos, c);
FontStr(" again to quit", pos);
Expand Down
2 changes: 1 addition & 1 deletion src/menu_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void MenuDisplayPlayerControls(
Vec2i textPos = Vec2iNew(pos.x - FontStrW(s) / 2, y - FontH());
FontStr(s, textPos);
textPos.y += FontH();
color_t c;
color_t c = colorWhite;
const char *buttonName =
InputGetButtonNameColor(*playerIndex, CMD_BUTTON1, &c);
textPos = FontStrMask(buttonName, textPos, c);
Expand Down

0 comments on commit a5d9a3f

Please sign in to comment.