Skip to content

Commit

Permalink
Add reference on @NpcRestock (#1254)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jhobean authored Jun 26, 2024
1 parent b55c3d9 commit 32c3a0e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
3 changes: 3 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3789,3 +3789,6 @@ Added: 'H' shortcut for variables to get the value as hexadecimal.
25-06-2024, Nolok
- Fixed: LASTUSED, LASTDISCONNECTED, TIMESTAMP being interpreted as a number with a different base (seconds or tenths of seconds or milliseconds) in different contexts. Now they expect in scripts only values in seconds.
- Fixed: crash when moving a char in an area full of teleporters, or whichever items made the char move multiple times in the same tick.

26-06-2024, Jhobean
- Changed: @NPCRESTOCK References modification. Now SRC:Server I:NPC (Before it was always server)
31 changes: 15 additions & 16 deletions src/game/chars/CCharNPC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,22 +282,21 @@ void CChar::NPC_LoadScript( bool fRestock )

CCharBase * pCharDef = Char_GetDef();

// 1) CHARDEF trigger
if ( m_pPlayer == nullptr ) // CHARDEF triggers (based on body type)
{
CChar * pChar = this->GetChar();
if ( pChar != nullptr )
{
CUID uidOldAct = pChar->m_Act_UID;
pChar->m_Act_UID = GetUID();
pChar->ReadScriptReducedTrig(pCharDef, CTRIG_Create);
pChar->m_Act_UID = uidOldAct;
}
}
//This remains untouched but moved after the chardef's section
if ( fRestock && IsTrigUsed(TRIGGER_NPCRESTOCK) )
ReadScriptReducedTrig(pCharDef, CTRIG_NPCRestock);

CChar * pChar = this->GetChar();
if (pChar != nullptr)
{
// 1) CHARDEF trigger
if ( m_pPlayer == nullptr ) // CHARDEF triggers (based on body type)
{
CUID uidOldAct = pChar->m_Act_UID;
pChar->m_Act_UID = GetUID();
pChar->ReadScriptReducedTrig(pCharDef, CTRIG_Create);
pChar->m_Act_UID = uidOldAct;
}
//This remains untouched but moved after the chardef's section
if ( fRestock && IsTrigUsed(TRIGGER_NPCRESTOCK) )
pChar->ReadScriptReducedTrig(pCharDef, CTRIG_NPCRestock);
}
CreateNewCharCheck(); //This one is giving stats, etc to the char, so we can read/set them in the next triggers.
}

Expand Down

0 comments on commit 32c3a0e

Please sign in to comment.