Skip to content

Commit 13cf293

Browse files
committed
Merge pull request #250 from alliedmodders/sdkhooks-newdecls
Convert remainder of sdkhooks.inc to newdecls (r=dvander).
1 parent a2b9c91 commit 13cf293

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

plugins/include/sdkhooks.inc

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -299,46 +299,43 @@ typeset SDKHookCB
299299
*
300300
* @param entity Entity index
301301
* @param classname Class name
302-
* @noreturn
303302
*/
304-
forward OnEntityCreated(entity, const String:classname[]);
303+
forward void OnEntityCreated(int entity, const char[] classname);
305304

306305
/**
307306
* @brief When an entity is destroyed
308307
*
309308
* @param entity Entity index
310-
* @noreturn
311309
*/
312-
forward OnEntityDestroyed(entity);
310+
forward void OnEntityDestroyed(int entity);
313311

314312
/**
315313
* @brief When the game description is retrieved
316314
*
317315
* @note Not supported on ep2v.
318316
*
319317
* @param gameDesc Game description
320-
* @noreturn
318+
* @return Plugin_Changed if gameDesc has been edited, else no change.
321319
*/
322-
forward Action:OnGetGameDescription(String:gameDesc[64]);
320+
forward Action OnGetGameDescription(char gameDesc[64]);
323321

324322
/**
325323
* @brief When the level is initialized
326324
*
327325
* @param mapName Name of the map
328326
* @param mapEntities Entities of the map
329-
* @noreturn
327+
* @return Plugin_Changed if mapEntities has been edited, else no change.
330328
*/
331-
forward Action:OnLevelInit(const String:mapName[], String:mapEntities[2097152]);
329+
forward Action OnLevelInit(const char[] mapName, char mapEntities[2097152]);
332330

333331
/**
334332
* @brief Hooks an entity
335333
*
336334
* @param entity Entity index
337335
* @param type Type of function to hook
338336
* @param callback Function to call when hook is called
339-
* @noreturn
340337
*/
341-
native SDKHook(entity, SDKHookType:type, SDKHookCB:callback);
338+
native void SDKHook(int entity, SDKHookType type, SDKHookCB callback);
342339

343340
/**
344341
* @brief Hooks an entity
@@ -348,17 +345,16 @@ native SDKHook(entity, SDKHookType:type, SDKHookCB:callback);
348345
* @param callback Function to call when hook is called
349346
* @return bool Hook Successful
350347
*/
351-
native bool:SDKHookEx(entity, SDKHookType:type, SDKHookCB:callback);
348+
native bool SDKHookEx(int entity, SDKHookType type, SDKHookCB callback);
352349

353350
/**
354351
* @brief Unhooks an entity
355352
*
356353
* @param entity Entity index
357354
* @param type Type of function to unhook
358355
* @param callback Callback function to unhook
359-
* @noreturn
360356
*/
361-
native SDKUnhook(entity, SDKHookType:type, SDKHookCB:callback);
357+
native void SDKUnhook(int entity, SDKHookType type, SDKHookCB callback);
362358

363359
/**
364360
* @brief Applies damage to an entity
@@ -373,9 +369,10 @@ native SDKUnhook(entity, SDKHookType:type, SDKHookCB:callback);
373369
* @param weapon Weapon index (orangebox and later) or -1 for unspecified
374370
* @param damageForce Velocity of damage force
375371
* @param damagePosition Origin of damage
376-
* @noreturn
377372
*/
378-
native SDKHooks_TakeDamage(entity, inflictor, attacker, Float:damage, damageType=DMG_GENERIC, weapon=-1, const Float:damageForce[3]=NULL_VECTOR, const Float:damagePosition[3]=NULL_VECTOR);
373+
native void SDKHooks_TakeDamage(int entity, int inflictor, int attacker,
374+
float damage, int damageType=DMG_GENERIC, int weapon=-1,
375+
const float damageForce[3]=NULL_VECTOR, const float damagePosition[3]=NULL_VECTOR);
379376

380377
/**
381378
* @brief Forces a client to drop the specified weapon
@@ -384,15 +381,15 @@ native SDKHooks_TakeDamage(entity, inflictor, attacker, Float:damage, damageType
384381
* @param weapon Weapon entity index.
385382
* @param vecTarget Location to toss weapon to, or NULL_VECTOR for default.
386383
* @param vecVelocity Velocity at which to toss weapon, or NULL_VECTOR for default.
387-
* @noreturn
388384
* @error Invalid client or weapon entity, weapon not owned by client.
389385
*/
390-
native SDKHooks_DropWeapon(client, weapon, const Float:vecTarget[3]=NULL_VECTOR, const Float:vecVelocity[3]=NULL_VECTOR);
386+
native void SDKHooks_DropWeapon(int client, int weapon, const float vecTarget[3]=NULL_VECTOR,
387+
const float vecVelocity[3]=NULL_VECTOR);
391388

392389
/**
393390
* Do not edit below this line!
394391
*/
395-
public Extension:__ext_sdkhooks =
392+
public Extension __ext_sdkhooks =
396393
{
397394
name = "SDKHooks",
398395
file = "sdkhooks.ext",

0 commit comments

Comments
 (0)