diff --git a/README.md b/README.md index ee928a928..3150af51a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ReGameDLL_CS [![Download](https://camo.githubusercontent.com/0c15c5ed5da356288ad4bb69ed24267fb48498f2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f73316c656e74712f526547616d65444c4c5f43532e737667)](https://github.com/s1lentq/ReGameDLL_CS/releases/latest) [![Downloads](https://camo.githubusercontent.com/7eb895bf12d373df1d7c2bd2af3eb7d6328cdf6c02eee380fa93f81365c32d41/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f646f776e6c6f6164732f73316c656e74712f526547616d65444c4c5f43532f746f74616c3f636f6c6f723d696d706f7274616e74)]() [![Percentage of issues still open](http://isitmaintained.com/badge/open/s1lentq/ReGameDLL_CS.svg)](http://isitmaintained.com/project/s1lentq/ReGameDLL_CS "Percentage of issues still open") [![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) Counter-Strike 1.6 GameDLL +# ReGameDLL_CS [![GitHub release (by tag)](https://img.shields.io/github/downloads/s1lentq/ReGameDLL_CS/latest/total)](https://github.com/s1lentq/ReGameDLL_CS/releases/latest) ![GitHub all releases](https://img.shields.io/github/downloads/s1lentq/ReGameDLL_CS/total) [![Percentage of issues still open](http://isitmaintained.com/badge/open/s1lentq/ReGameDLL_CS.svg)](http://isitmaintained.com/project/s1lentq/ReGameDLL_CS "Percentage of issues still open") [![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) Counter-Strike 1.6 GameDLL Reverse-engineered gamedll (mp.dll / Counter-Strike) ## What is this? diff --git a/dist/game.cfg b/dist/game.cfg index a1d77c205..7d0775713 100644 --- a/dist/game.cfg +++ b/dist/game.cfg @@ -480,7 +480,7 @@ mp_free_armor "0" // 1 - Affects teammates (default behaviour) // // Default value: "1" -mp_team_flash 1 +mp_team_flash "1" // Players can receive all other players text chat, team restrictions apply. // 0 - disabled (default behaviour) @@ -566,4 +566,4 @@ mp_freezetime_duck "1" // 1 - enabled (default behaviour) // // Default value: "1" -mp_freezetime_jump "1" \ No newline at end of file +mp_freezetime_jump "1" diff --git a/regamedll/dlls/bot/cs_bot_manager.cpp b/regamedll/dlls/bot/cs_bot_manager.cpp index 7793e8151..6324ceeb7 100644 --- a/regamedll/dlls/bot/cs_bot_manager.cpp +++ b/regamedll/dlls/bot/cs_bot_manager.cpp @@ -1452,6 +1452,7 @@ void CCSBotManager::SetLooseBomb(CBaseEntity *bomb) if (bomb) { m_looseBombArea = TheNavAreaGrid.GetNearestNavArea(&bomb->pev->origin); + DbgAssert(m_looseBombArea); // TODO: Need investigation and find out why it cannot find nearest area for a lost bomb, just catch it } else { diff --git a/regamedll/dlls/bot/states/cs_bot_hunt.cpp b/regamedll/dlls/bot/states/cs_bot_hunt.cpp index d10826751..aa701db9d 100644 --- a/regamedll/dlls/bot/states/cs_bot_hunt.cpp +++ b/regamedll/dlls/bot/states/cs_bot_hunt.cpp @@ -95,10 +95,15 @@ void HuntState::OnUpdate(CCSBot *me) { if (!me->IsRogue() && me->CanSeeLooseBomb()) { + CNavArea *looseBombArea = TheCSBots()->GetLooseBombArea(); + // if we are near the loose bomb and can see it, hide nearby and guard it me->SetTask(CCSBot::GUARD_LOOSE_BOMB); - me->Hide(TheCSBots()->GetLooseBombArea()); - me->GetChatter()->AnnouncePlan("GoingToGuardLooseBomb", TheCSBots()->GetLooseBombArea()->GetPlace()); + me->Hide(looseBombArea); + + if (looseBombArea) + me->GetChatter()->AnnouncePlan("GoingToGuardLooseBomb", looseBombArea->GetPlace()); + return; } else if (TheCSBots()->IsBombPlanted()) diff --git a/regamedll/game_shared/bot/nav_area.cpp b/regamedll/game_shared/bot/nav_area.cpp index f0c9de93c..4e4bb309d 100644 --- a/regamedll/game_shared/bot/nav_area.cpp +++ b/regamedll/game_shared/bot/nav_area.cpp @@ -294,6 +294,8 @@ void CNavArea::OnDestroyNotify(CNavArea *dead) // Connect this area to given area in given direction void CNavArea::ConnectTo(CNavArea *area, NavDirType dir) { + DbgAssert(area); + // check if already connected for (NavConnectList::iterator iter = m_connect[dir].begin(); iter != m_connect[dir].end(); iter++) { diff --git a/regamedll/game_shared/bot/nav_area.h b/regamedll/game_shared/bot/nav_area.h index 87fbb3695..434424a1c 100644 --- a/regamedll/game_shared/bot/nav_area.h +++ b/regamedll/game_shared/bot/nav_area.h @@ -683,7 +683,7 @@ bool NavAreaBuildPath(CNavArea *startArea, CNavArea *goalArea, const Vector *goa int ladderTopDir; while (true) { - CNavArea *newArea; + CNavArea *newArea = nullptr; NavTraverseType how; const CNavLadder *ladder = nullptr; @@ -716,6 +716,11 @@ bool NavAreaBuildPath(CNavArea *startArea, CNavArea *goalArea, const Vector *goa newArea = (*floorIter).area; how = (NavTraverseType)dir; floorIter++; + + DbgAssert(newArea); + + if (!newArea) + continue; } // search ladders else