Skip to content

Commit ed40cc6

Browse files
committed
Hotreloading is now a class
1 parent 54f5136 commit ed40cc6

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/game/server/entities/character.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -768,18 +768,12 @@ void CCharacter::Tick()
768768
State.m_pCollision = Collision();
769769
State.m_ppPlayers = GameServer()->m_apPlayers;
770770

771+
static TWBL::CHotreloader Hotreloader("./libtwbl_bottick.so", "Follow");
771772
FTwbl_BotTick BotTick;
772-
void *pHandle = TWBL::LoadTick("./libtwbl_bottick.so", "Follow", &BotTick);
773+
void *pHandle = Hotreloader.LoadTick(&BotTick);
773774

774775
if(pHandle)
775-
{
776776
BotTick(&State, &Bot);
777-
int Err = TWBL::UnloadTick(pHandle);
778-
if(Err)
779-
{
780-
dbg_msg("twbl", "failed to close err=%d", Err);
781-
}
782-
}
783777
else
784778
Twbl_SampleTick(&State, &Bot);
785779

0 commit comments

Comments
 (0)