Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reference on @NpcRestock #1254

Merged
merged 2 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading