mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Bots don't use boost items in the air
No Sneaker, Rocket Sneaker, or Ring waste when they can't apply!
This commit is contained in:
parent
b1b77e9496
commit
aa7c7fbf94
1 changed files with 18 additions and 0 deletions
|
|
@ -486,6 +486,12 @@ static void K_BotItemGenericOrbitShield(player_t *player, ticcmd_t *cmd)
|
||||||
--------------------------------------------------*/
|
--------------------------------------------------*/
|
||||||
static void K_BotItemSneaker(player_t *player, ticcmd_t *cmd)
|
static void K_BotItemSneaker(player_t *player, ticcmd_t *cmd)
|
||||||
{
|
{
|
||||||
|
if (P_IsObjectOnGround(player->mo) == false)
|
||||||
|
{
|
||||||
|
// Don't use while mid-air.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ((player->offroad && K_ApplyOffroad(player)) // Stuck in offroad, use it NOW
|
if ((player->offroad && K_ApplyOffroad(player)) // Stuck in offroad, use it NOW
|
||||||
|| K_GetWaypointIsShortcut(player->nextwaypoint) == true // Going toward a shortcut!
|
|| K_GetWaypointIsShortcut(player->nextwaypoint) == true // Going toward a shortcut!
|
||||||
|| player->speed < K_GetKartSpeed(player, false, true) / 2 // Being slowed down too much
|
|| player->speed < K_GetKartSpeed(player, false, true) / 2 // Being slowed down too much
|
||||||
|
|
@ -518,6 +524,12 @@ static void K_BotItemSneaker(player_t *player, ticcmd_t *cmd)
|
||||||
--------------------------------------------------*/
|
--------------------------------------------------*/
|
||||||
static void K_BotItemRocketSneaker(player_t *player, ticcmd_t *cmd)
|
static void K_BotItemRocketSneaker(player_t *player, ticcmd_t *cmd)
|
||||||
{
|
{
|
||||||
|
if (P_IsObjectOnGround(player->mo) == false)
|
||||||
|
{
|
||||||
|
// Don't use while mid-air.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (player->botvars.itemconfirm > TICRATE)
|
if (player->botvars.itemconfirm > TICRATE)
|
||||||
{
|
{
|
||||||
if (player->sneakertimer == 0 && K_ItemButtonWasDown(player) == false)
|
if (player->sneakertimer == 0 && K_ItemButtonWasDown(player) == false)
|
||||||
|
|
@ -1182,6 +1194,12 @@ static void K_BotItemRings(player_t *player, ticcmd_t *cmd)
|
||||||
{
|
{
|
||||||
INT32 saferingsval = 16 - K_GetKartRingPower(player, false);
|
INT32 saferingsval = 16 - K_GetKartRingPower(player, false);
|
||||||
|
|
||||||
|
if (P_IsObjectOnGround(player->mo) == false)
|
||||||
|
{
|
||||||
|
// Don't use while mid-air.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (player->speed < K_GetKartSpeed(player, false, true) / 2 // Being slowed down too much
|
if (player->speed < K_GetKartSpeed(player, false, true) / 2 // Being slowed down too much
|
||||||
|| player->speedboost > (FRACUNIT/5)) // Have another type of boost (tethering)
|
|| player->speedboost > (FRACUNIT/5)) // Have another type of boost (tethering)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue