Skip to content

Commit

Permalink
Hotreloading is now a class
Browse files Browse the repository at this point in the history
  • Loading branch information
ChillerDragon committed May 28, 2024
1 parent 54f5136 commit ed40cc6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/external/TeeworldsBotLib
10 changes: 2 additions & 8 deletions src/game/server/entities/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit ed40cc6

Please sign in to comment.