Remove template checking, doesnt work.

Consider GetGameTime() alternative?
This commit is contained in:
zaCade 2019-04-08 12:53:24 +02:00
parent 16b304238e
commit ecbf18e14f
3 changed files with 3 additions and 40 deletions

View File

@ -12,7 +12,6 @@ methodmap CItem < Basic
myclass.SetHandle("dConfig", value);
myclass.SetInt("iTempID", -1);
myclass.SetInt("iClient", INVALID_ENT_REFERENCE);
myclass.SetInt("iButton", INVALID_ENT_REFERENCE);
myclass.SetInt("iWeapon", INVALID_ENT_REFERENCE);
@ -38,18 +37,6 @@ methodmap CItem < Basic
}
property int iTempID
{
public get()
{
return this.GetInt("iTempID");
}
public set(int value)
{
this.SetInt("iTempID", value);
}
}
property int iClient
{
public get()

View File

@ -283,15 +283,13 @@ stock bool RegisterItemEntity(CItem item, int entity, int type)
{
int iOwner = Entity_GetOwner(entity);
int iParent = Entity_GetParent(entity);
int iTempID = Entity_GetTempID(entity);
switch(type)
{
case REGISTER_WEAPON:
{
if (!item.bWeapon && item.iTempID == iTempID && (iOwner == INVALID_ENT_REFERENCE))
if (!item.bWeapon && (iOwner == INVALID_ENT_REFERENCE))
{
item.iTempID = iTempID;
item.iWeapon = entity;
return true;
@ -299,11 +297,10 @@ stock bool RegisterItemEntity(CItem item, int entity, int type)
}
case REGISTER_BUTTON:
{
if (!item.bButton && item.iTempID == iTempID && (iParent == INVALID_ENT_REFERENCE || (item.bWeapon && iParent == item.iWeapon)))
if (!item.bButton && (iParent == INVALID_ENT_REFERENCE || (item.bWeapon && iParent == item.iWeapon)))
{
SDKHook(entity, SDKHook_Use, OnButtonPress);
item.iTempID = iTempID;
item.iButton = entity;
return true;
@ -311,13 +308,12 @@ stock bool RegisterItemEntity(CItem item, int entity, int type)
}
case REGISTER_TRIGGER:
{
if (!item.bTrigger && item.iTempID == iTempID && (iParent == INVALID_ENT_REFERENCE || (item.bWeapon && iParent == item.iWeapon)))
if (!item.bTrigger && (iParent == INVALID_ENT_REFERENCE || (item.bWeapon && iParent == item.iWeapon)))
{
SDKHook(entity, SDKHook_StartTouch, OnTriggerTouch);
SDKHook(entity, SDKHook_EndTouch, OnTriggerTouch);
SDKHook(entity, SDKHook_Touch, OnTriggerTouch);
item.iTempID = iTempID;
item.iTrigger = entity;
return true;

View File

@ -116,26 +116,6 @@ stock int Entity_GetParent(int entity)
return GetEntPropEnt(entity, Prop_Data, "m_pParent");
}
/**
* Gets the template id of an entity.
*
* @param entity Entity index.
* @return Template ID or -1
*/
stock int Entity_GetTempID(int entity)
{
char name[128];
GetEntPropString(entity, Prop_Data, "m_iName", name, sizeof(name));
int index
if ((index = FindCharInString(name, '&', true)) != -1)
{
return view_as<int>(StringToInt(name[index + 1]));
}
return -1;
}
/**
* Sets the Name of an entity.
*