Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Commit

Permalink
Last grenade only teleports if exists
Browse files Browse the repository at this point in the history
  • Loading branch information
marqdevx committed Mar 4, 2024
1 parent eb76e7d commit 289510f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -735,5 +735,10 @@ CON_COMMAND_CHAT(last, "Teleport to the last thrown grenade")

ZEPlayer *pPlayer = g_playerManager->GetPlayer(player->GetPlayerSlot());

if(pPlayer->lastThrow_position.x == 0.0f && pPlayer->lastThrow_position.y == 0.0f && pPlayer->lastThrow_position.z == 0.0f){
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX "No lineup saved");
return;
}

player->GetPawn()->Teleport(&pPlayer->lastThrow_position, &pPlayer->lastThrow_rotation, nullptr);
}
2 changes: 2 additions & 0 deletions src/playermanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ class ZEPlayer
m_bInGame = false;
m_iMZImmunity = 0; // out of 100
m_flNominateTime = -60.0f;

lastThrow_position = Vector(0,0,0);
}

~ZEPlayer()
Expand Down

0 comments on commit 289510f

Please sign in to comment.