Skip to content

Commit

Permalink
Rename FindServerClass
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenzzer committed Feb 26, 2024
1 parent 3e25204 commit 1d35ff7
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion core/HalfLife2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ ServerClass *CHalfLife2::FindServerClass(const char *classname)
return pInfo->sc;
}

ServerClass *CHalfLife2::FindServerClass(CBaseEntity *pEntity)
ServerClass *CHalfLife2::FindEntityServerClass(CBaseEntity *pEntity)
{
IServerNetworkable* pNetwork = ((IServerUnknown *)pEntity)->GetNetworkable();
if (pNetwork == nullptr)
Expand Down
2 changes: 1 addition & 1 deletion core/HalfLife2.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class CHalfLife2 :
bool FindSendPropInfo(const char *classname, const char *offset, sm_sendprop_info_t *info);
datamap_t *GetDataMap(CBaseEntity *pEntity);
ServerClass *FindServerClass(const char *classname);
ServerClass *FindServerClass(CBaseEntity *pEntity);
ServerClass *FindEntityServerClass(CBaseEntity *pEntity);
typedescription_t *FindInDataMap(datamap_t *pMap, const char *offset);
bool FindDataMapInfo(datamap_t *pMap, const char *offset, sm_datatable_info_t *pDataTable);
void SetEdictStateChanged(edict_t *pEdict, unsigned short offset);
Expand Down
6 changes: 3 additions & 3 deletions core/smn_entities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ static cell_t GetEntityNetClass(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("Invalid entity (%d - %d)", g_HL2.ReferenceToIndex(params[1]), params[1]);
}

ServerClass *pClass = g_HL2.FindServerClass(pEntity);
ServerClass *pClass = g_HL2.FindEntityServerClass(pEntity);
if (!pClass)
{
return 0;
Expand Down Expand Up @@ -1262,7 +1262,7 @@ static cell_t SetEntDataString(IPluginContext *pContext, const cell_t *params)
#define FIND_PROP_SEND(type, type_name) \
sm_sendprop_info_t info;\
SendProp *pProp; \
ServerClass *pServerClass = g_HL2.FindServerClass(pEntity); \
ServerClass *pServerClass = g_HL2.FindEntityServerClass(pEntity); \
if (pServerClass == nullptr) { \
pContext->ThrowNativeError("Failed to retrieve entity %d (%d) server class!", g_HL2.ReferenceToIndex(params[1]), params[1]); \
} \
Expand Down Expand Up @@ -1424,7 +1424,7 @@ static cell_t GetEntPropArraySize(IPluginContext *pContext, const cell_t *params
{
sm_sendprop_info_t info;

ServerClass *pServerClass = g_HL2.FindServerClass(pEntity);
ServerClass *pServerClass = g_HL2.FindEntityServerClass(pEntity);
if (pServerClass == nullptr)
{
return pContext->ThrowNativeError("Failed to retrieve entity %d (%d) server class!", g_HL2.ReferenceToIndex(params[1]), params[1]);
Expand Down
2 changes: 1 addition & 1 deletion extensions/cstrike/natives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ static cell_t CS_DropWeapon(IPluginContext *pContext, const cell_t *params)

//Psychonic is awesome for this
sm_sendprop_info_t spi;
ServerClass *pServerClass = gamehelpers->FindServerClass(pWeapon);
ServerClass *pServerClass = gamehelpers->FindEntityServerClass(pWeapon);
if (pServerClass == nullptr)
{
return pContext->ThrowNativeError("Failed to retrieve entity %d server class!", params[2]);
Expand Down
2 changes: 1 addition & 1 deletion extensions/sdkhooks/extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ HookReturn SDKHooks::Hook(int entity, SDKHookType type, IPluginFunction *callbac

if (!!strcmp(g_HookTypes[type].dtReq, ""))
{
ServerClass *pServerClass = gamehelpers->FindServerClass(pEnt);
ServerClass *pServerClass = gamehelpers->FindEntityServerClass(pEnt);
if (pServerClass == nullptr)
{
return HookRet_BadEntForHookType;
Expand Down
2 changes: 1 addition & 1 deletion extensions/sdkhooks/natives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ cell_t Native_DropWeapon(IPluginContext *pContext, const cell_t *params)
if (!pWeapon)
return pContext->ThrowNativeError("Invalid entity index %d for weapon", params[2]);

ServerClass *pClass = gamehelpers->FindServerClass(pWeapon);
ServerClass *pClass = gamehelpers->FindEntityServerClass(pWeapon);
if (pClass == nullptr)
{
return pContext->ThrowNativeError("Failed to retrieve entity %d server class!", params[2]);
Expand Down
2 changes: 1 addition & 1 deletion extensions/sdktools/gamerulesnatives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static CBaseEntity *FindEntityByNetClass(int start, const char *classname)
continue;
}

ServerClass *pServerClass = gamehelpers->FindServerClass(pEntity);
ServerClass *pServerClass = gamehelpers->FindEntityServerClass(pEntity);
if (pServerClass == nullptr)
{
continue;
Expand Down
2 changes: 1 addition & 1 deletion extensions/sdktools/teamnatives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void InitTeamNatives()
continue;
}

ServerClass *pClass = gamehelpers->FindServerClass(pEntity);
ServerClass *pClass = gamehelpers->FindEntityServerClass(pEntity);
if (pClass == nullptr)
{
continue;
Expand Down
2 changes: 1 addition & 1 deletion extensions/sdktools/vglobals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ void GetResourceEntity()
continue;
}

ServerClass *pClass = gamehelpers->FindServerClass(pEntity);
ServerClass *pClass = gamehelpers->FindEntityServerClass(pEntity);
if (pClass == nullptr)
{
continue;
Expand Down
4 changes: 2 additions & 2 deletions extensions/sdktools/vnatives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1672,7 +1672,7 @@ static cell_t LookupEntityAttachment(IPluginContext* pContext, const cell_t* par
CBaseEntity* pEntity;
ENTINDEX_TO_CBASEENTITY(params[1], pEntity);

ServerClass* pClass = gamehelpers->FindServerClass(pEntity);
ServerClass* pClass = gamehelpers->FindEntityServerClass(pEntity);
if (pClass == nullptr)
{
return pContext->ThrowNativeError("Failed to retrieve entity %d (%d) server class!", gamehelpers->ReferenceToIndex(params[1]), params[1]);
Expand Down Expand Up @@ -1723,7 +1723,7 @@ static cell_t GetEntityAttachment(IPluginContext* pContext, const cell_t* params
CBaseEntity* pEntity;
ENTINDEX_TO_CBASEENTITY(params[1], pEntity);

ServerClass* pClass = gamehelpers->FindServerClass(pEntity);
ServerClass* pClass = gamehelpers->FindEntityServerClass(pEntity);
if (pClass == nullptr)
{
return pContext->ThrowNativeError("Failed to retrieve entity %d (%d) server class!", gamehelpers->ReferenceToIndex(params[1]), params[1]);
Expand Down
6 changes: 3 additions & 3 deletions extensions/tf2/criticals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ bool CritManager::TryEnable()
continue;
}

ServerClass *pServerClass = gamehelpers->FindServerClass(pEntity);
ServerClass *pServerClass = gamehelpers->FindEntityServerClass(pEntity);
if (pServerClass == nullptr)
{
continue;
Expand Down Expand Up @@ -125,7 +125,7 @@ void CritManager::OnEntityCreated(CBaseEntity *pEntity, const char *classname)
return;
}

ServerClass *pServerClass = gamehelpers->FindServerClass(pEntity);
ServerClass *pServerClass = gamehelpers->FindEntityServerClass(pEntity);
if (pServerClass == nullptr)
{
return;
Expand Down Expand Up @@ -175,7 +175,7 @@ bool CritManager::Hook_CalcIsAttackCriticalHelpers(bool noCrits)
CBaseEntity *pWeapon = META_IFACEPTR(CBaseEntity);

// If there's an invalid ent or invalid server class here, we've got issues elsewhere.
ServerClass *pServerClass = gamehelpers->FindServerClass(pWeapon);
ServerClass *pServerClass = gamehelpers->FindEntityServerClass(pWeapon);
if (pServerClass == nullptr)
{
g_pSM->LogError(myself, "Invalid server class on weapon.");
Expand Down
2 changes: 1 addition & 1 deletion extensions/tf2/extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ int FindEntityByNetClass(int start, const char *classname)
continue;
}

ServerClass *pServerClass = gamehelpers->FindServerClass(pEntity);
ServerClass *pServerClass = gamehelpers->FindEntityServerClass(pEntity);
if (pServerClass == nullptr)
{
continue;
Expand Down
2 changes: 1 addition & 1 deletion public/IGameHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ namespace SourceMod
*
* @return ServerClass pointer on success, nullptr on failure.
*/
virtual ServerClass *FindServerClass(CBaseEntity *pEntity) = 0;
virtual ServerClass *FindEntityServerClass(CBaseEntity *pEntity) = 0;
};
}

Expand Down

0 comments on commit 1d35ff7

Please sign in to comment.