diff --git a/src/external/TeeworldsBotLib b/src/external/TeeworldsBotLib index e1f4cba1028..941fe5b6995 160000 --- a/src/external/TeeworldsBotLib +++ b/src/external/TeeworldsBotLib @@ -1 +1 @@ -Subproject commit e1f4cba1028ef28750945e97f93431b8766bca3e +Subproject commit 941fe5b69958e234d636925df915eed215a1be86 diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp index fc3b05a7868..7fe72567310 100644 --- a/src/game/server/entities/character.cpp +++ b/src/game/server/entities/character.cpp @@ -768,18 +768,12 @@ void CCharacter::Tick() State.m_pCollision = Collision(); State.m_ppPlayers = GameServer()->m_apPlayers; + static TWBL::CHotreloader Hotreloader("./libtwbl_bottick.so", "Follow"); FTwbl_BotTick BotTick; - void *pHandle = TWBL::LoadTick("./libtwbl_bottick.so", "Follow", &BotTick); + void *pHandle = Hotreloader.LoadTick(&BotTick); if(pHandle) - { BotTick(&State, &Bot); - int Err = TWBL::UnloadTick(pHandle); - if(Err) - { - dbg_msg("twbl", "failed to close err=%d", Err); - } - } else Twbl_SampleTick(&State, &Bot);