From 67ab8f0a05416f741dc83236bd8654afd3a276c1 Mon Sep 17 00:00:00 2001 From: Dmitriy Date: Tue, 16 Jun 2015 12:57:30 +0300 Subject: [PATCH] fixed cs 1.0 crash :) --- source/basecode.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/basecode.cpp b/source/basecode.cpp index 027fb66..e67c1e2 100644 --- a/source/basecode.cpp +++ b/source/basecode.cpp @@ -1164,7 +1164,7 @@ void Bot::ChatterMessage (int message) { // this function inserts the voice message into the message queue (mostly same as above) - if (yb_communication_type.GetInt () != 2 || g_chatterFactory[message].IsEmpty () || GetNearbyFriendsNearPosition (pev->origin, 9999) == 0) + if (g_gameVersion == CSV_OLD || yb_communication_type.GetInt () != 2 || g_chatterFactory[message].IsEmpty () || GetNearbyFriendsNearPosition (pev->origin, 9999) == 0) return; bool shouldExecute = false; @@ -6127,8 +6127,13 @@ void Bot::EquipInBuyzone (int buyCount) { // this function is gets called when bot enters a buyzone, to allow bot to buy some stuff + bool checkBuyTime = false; + + if (mp_buytime.m_eptr != NULL) + checkBuyTime = (g_timeRoundStart + Random.Float (10.0, 20.0) + mp_buytime.GetFloat () < GetWorldTime ()); + // if bot is in buy zone, try to buy ammo for this weapon... - if (m_lastEquipTime + 15.0 < GetWorldTime () && m_inBuyZone && g_timeRoundStart + Random.Float (10.0, 20.0) + mp_buytime.GetFloat () < GetWorldTime () && !g_bombPlanted && m_moneyAmount > g_botBuyEconomyTable[0]) + if (m_lastEquipTime + 15.0 < GetWorldTime () && m_inBuyZone && checkBuyTime && !g_bombPlanted && m_moneyAmount > g_botBuyEconomyTable[0]) { m_buyingFinished = false; m_buyState = buyCount;