Skip to content

Commit

Permalink
Merge pull request entropy-zero#270 from Blixibon/mapbase/feature/dyn…
Browse files Browse the repository at this point in the history
…amic-interaction-improvements

NPC dynamic interaction improvements and fixes
  • Loading branch information
Blixibon authored Feb 4, 2024
2 parents 47ddedb + 8b7c695 commit 4cea5d1
Show file tree
Hide file tree
Showing 9 changed files with 453 additions and 68 deletions.
17 changes: 17 additions & 0 deletions sp/src/game/server/ai_activity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,23 @@ int CAI_BaseNPC::GetActivityID(const char* actName)
return m_pActivitySR->GetStringID(actName);
}

#ifdef MAPBASE
//-----------------------------------------------------------------------------
// Purpose: Gets an activity ID or registers a new private one if it doesn't exist
//-----------------------------------------------------------------------------
int CAI_BaseNPC::GetOrRegisterActivity( const char *actName )
{
int actID = GetActivityID( actName );
if (actID == ACT_INVALID)
{
actID = ActivityList_RegisterPrivateActivity( actName );
AddActivityToSR( actName, actID );
}

return actID;
}
#endif

#define ADD_ACTIVITY_TO_SR(activityname) AddActivityToSR(#activityname,activityname)

//-----------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit 4cea5d1

Please sign in to comment.