fix: bot kick menu isn't functional

nav: probably fix for ladder climbing (ref #544 ref #319)
bot: implemented [RSE] Neoptolemus's fix for msec calculation (round vs int cast)
This commit is contained in:
jeefo 2024-03-27 23:21:00 +03:00
commit df9bc66023
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED
6 changed files with 52 additions and 23 deletions

View file

@ -3713,12 +3713,6 @@ Vector Bot::isBombAudible () {
return nullptr;
}
uint8_t Bot::computeMsec () {
// estimate msec to use for this command based on time passed from the previous command
return static_cast <uint8_t> (cr::min (static_cast <int32_t> ((game.time () - m_lastCommandTime) * 1000.0f), 255));
}
bool Bot::canRunHeavyWeight () {
constexpr auto interval = 1.0f / 10.0f;
@ -3730,6 +3724,21 @@ bool Bot::canRunHeavyWeight () {
return false;
}
uint8_t Bot::computeMsec () {
// estimate msec to use for this command based on time passed from the previous command
return static_cast <uint8_t> (cr::min (static_cast <int32_t> (cr::roundf ((game.time () - m_lastCommandTime) * 1000.0f)), 255));
}
const Vector &Bot::getRpmAngles () {
// get angles to pass to run player move function
if ((m_pathFlags & NodeFlag::Ladder) || getCurrentTaskId () == Task::Attack) {
return pev->v_angle;
}
return m_moveAngles;
}
void Bot::runMovement () {
// the purpose of this function is to compute, according to the specified computation
// method, the msec value which will be passed as an argument of pfnRunPlayerMove. This