Fixed ent bugs from JGHG

Changed MAKE_STRING to ALLOC_STRING
This commit is contained in:
David Anderson 2004-07-06 16:48:20 +00:00
parent 1d555a66f8
commit 221d5b623d
2 changed files with 3 additions and 7 deletions

View File

@ -3,12 +3,8 @@
int AmxStringToEngine(AMX *amx, cell param, int &len)
{
char *szString = MF_GetAmxString(amx, param, 0, &len);
char *szCopy = new char[len+1];
memset(szCopy, 0, len+1);
strcpy(szCopy, szString);
return MAKE_STRING(szCopy);
return ALLOC_STRING(szString);
}
void OnAmxxAttach()

View File

@ -5,7 +5,7 @@ int is_ent_valid(int iEnt)
if (iEnt < 1 || iEnt > gpGlobals->maxEntities)
return 0;
if (iEnt >= 1 || iEnt <= 32)
if (iEnt >= 1 && iEnt <= 32)
if (!MF_IsPlayerIngame(iEnt))
return 0;
@ -91,7 +91,7 @@ static cell AMX_NATIVE_CALL force_use(AMX *amx, cell *params)
edict_t *pUser = INDEXENT(iPtr);
edict_t *pUsed = INDEXENT(iPtd);
MDLL_Touch(pUsed, pUser);
MDLL_Use(pUsed, pUser);
return 1;
}