Skip to content

Commit 25eda8d

Browse files
committed
fix get pdata
1 parent 09398ff commit 25eda8d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

api_custom_entities.sma

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ bool:@Entity_CanActivate(this, pTarget) {
750750

751751
Trie:@Entity_GetPData(this) {
752752
// Return the current allocated data if the entity is at the initialization stage
753-
if (g_itPData != Invalid_Trie && GetPDataMember(g_itPData, CE_MEMBER_POINTER)) {
753+
if (g_itPData != Invalid_Trie && GetPDataMember(g_itPData, CE_MEMBER_POINTER) == this) {
754754
return g_itPData;
755755
}
756756

@@ -770,6 +770,7 @@ Trie:@Entity_AllocPData(this, iId) {
770770

771771
@Entity_FreePData(this) {
772772
new Trie:itPData = @Entity_GetPData(this);
773+
773774
new iId = GetPDataMember(itPData, CE_MEMBER_ID);
774775
ExecuteHookFunction(CEFunction_Remove, iId, this);
775776

0 commit comments

Comments
 (0)