-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New version #1
Open
Hedgefog
wants to merge
231
commits into
master
Choose a base branch
from
next
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
New version #1
Changes from 152 commits
Commits
Show all changes
231 commits
Select commit
Hold shift + click to select a range
1d1519f
new custom entities api
Hedgefog 9f16803
add player dizziness api
Hedgefog 8316048
update log message
Hedgefog 4d5ff38
add custome animations system
Hedgefog 5c2bb6b
fix PlayerModel_Get native args
Hedgefog da3d8ac
move allocated classname string to global var
Hedgefog 1190e82
update player model api
Hedgefog 0439bd6
improve model reset
Hedgefog 7558ae7
fix corpse model
Hedgefog e509948
improve player model api
Hedgefog f277b98
update player model api
Hedgefog 05ddcd6
update natives error
Hedgefog dba0d6a
update custom entities api
Hedgefog af8c12a
fix memory leaks
Hedgefog 5b37eb2
fix model update
Hedgefog eb2d042
fix naming
Hedgefog 99c0c6b
add init function
Hedgefog b35e9ea
add think function
Hedgefog e538944
update CheckWinConditions forward
Hedgefog 93f686d
add touch function
Hedgefog 09398ff
add default value for origin
Hedgefog 25eda8d
fix get pdata
Hedgefog 183e8e5
fix init function
Hedgefog c329d9f
fix next kill handle
Hedgefog 54ef28a
fix temp flag
Hedgefog c02a904
add CE_DeleteMember native
Hedgefog f8a601e
add restart function
Hedgefog 45af9ff
add navsystem api (alpha)
Hedgefog ed291e7
fix callback logic
Hedgefog 8e8b2f5
add sync job termination
Hedgefog d0c0ee1
fix SetString method
Hedgefog 8f6bbaf
add inventory api
Hedgefog 12cf015
add cosmetics api
Hedgefog 1bb5272
fix api headers
Hedgefog 7bccbe1
fix think
Hedgefog bb044e4
fix inventory slots saving
Hedgefog ce2670a
add blood color
Hedgefog dd8f327
add fire entity
Hedgefog 16ff7d8
update custom entities api
Hedgefog 6533348
update repo structure
Hedgefog f3988f0
update player inventory api
Hedgefog 41d7858
fire scale now depends on the burning object size
Hedgefog a2e930f
fix rounds api dir structure
Hedgefog 76e502a
fix followed fire kill logic
Hedgefog 814152e
update custom entities api
Hedgefog be11622
improve fire entity logic
Hedgefog 69d2263
disabled spread by default
Hedgefog b89de4a
remove unused util
Hedgefog 6c7ac81
fix fire think rate
Hedgefog a2b37c6
update custom entities api
Hedgefog 3ee6376
remove unused include
Hedgefog 7da44ea
update fire entity code
Hedgefog af15932
disable solid check for damage
Hedgefog f531f83
fix get string member native
Hedgefog e191aee
fix plugin name
Hedgefog 6ac6674
fix return for get vector and string member natives
Hedgefog 07308c4
add pushing system api
Hedgefog d1d2879
fix include
Hedgefog a246995
fix native params order
Hedgefog 1f9843f
update rounds api
Hedgefog 66df476
add forwards
Hedgefog 04e179a
add waypoint marker api
Hedgefog aebe4de
fix hidden markers
Hedgefog a4469f7
rename advanced pushing library
Hedgefog cd9d072
fix params order
Hedgefog 22d7711
fix command util
Hedgefog a7a62ec
rework initialization for custom entities
Hedgefog 5847d86
add tag for custom entites handler
Hedgefog e57d51b
small fixes
Hedgefog 3594c9d
update command util
Hedgefog 148a743
update command util
Hedgefog 869c733
update commands
Hedgefog 54f2e08
fix auto precaching
Hedgefog 68eb206
add datapack stocks
Hedgefog c7e9c51
add custom events api
Hedgefog 81e1860
better error handler
Hedgefog 767a59f
rework custom events
Hedgefog d6c2697
fix forward name
Hedgefog 9fa850b
add custom_events_handler entity
Hedgefog 289cc2e
fix forward params
Hedgefog c708007
fix marker visibility
Hedgefog aa5834a
fix memory leaks
Hedgefog 5531a1a
fix semicolons
Hedgefog 878d304
fix semicolons
Hedgefog 70c1f96
add custom events api documentation
Hedgefog 759d795
move MAX_CUSTOM_EVENT_KEY_LENGTH constant to header file
Hedgefog 6a13cbe
add documentation
Hedgefog 1cec196
fix indentation
Hedgefog 5fa7c99
add custom weapon example
Hedgefog afcc091
codestyle update
Hedgefog cd44c67
fix plugin name
Hedgefog 387bc19
Update README.md
Hedgefog 5152e3a
Update README.md
Hedgefog 5b5132a
Update README.md
Hedgefog 469002f
Update README.md
Hedgefog c81cb22
add camera target
Hedgefog 4ce12ab
update custom entities api
Hedgefog a4c6113
add particle system
Hedgefog aa1f080
remove useless params
Hedgefog fb36a9d
add readme
Hedgefog bf62252
update particles api
Hedgefog f411c30
Update entity_fire.sma
Hedgefog aee0f08
fix movetype
Hedgefog 7b3d624
fix marker destroy
Hedgefog ccdee4c
fix sprite check
Hedgefog 5f275ab
add custom rounds api for Half-Life
Hedgefog eaf3c2f
add axis lock option
Hedgefog 96fb3ec
add hl support
Hedgefog a604c44
improve custom rounds
Hedgefog 2e1b517
add some natives
Hedgefog fa49252
fix round termination
Hedgefog caf2589
fix hl crashes
Hedgefog 4e80e88
fix custom rounds system
Hedgefog 53991bc
update round messages
Hedgefog 798245b
fix frozen flag set
Hedgefog 8c05802
better hl support
Hedgefog 3cb72fc
add start time native
Hedgefog 652c4d1
fix round restart
Hedgefog 32b2bad
fix scale calculation
Hedgefog 698a9a3
fix visibility check for Half-Life
Hedgefog 2f48a94
fix round system
Hedgefog 385df40
improve custom rounds api
Hedgefog 2e3950a
add CEFunction_Invalid constant
Hedgefog ce5ae4f
update readme
Hedgefog 53675e9
fix return value
Hedgefog 852f5c6
fix cstrike variables
Hedgefog f1ca040
fix touched hook
Hedgefog c780048
add traverse type getter for area and segment
Hedgefog 580dfdc
add navsystem api example example
Hedgefog 0417111
add StructCopy function
Hedgefog 1e7e1e8
fix custom events api
Hedgefog 1e54641
add custom methods functionality
Hedgefog 51acf21
make datapack library optional
Hedgefog 0af3529
fix member name
Hedgefog d12cfa9
fix update timer forward
Hedgefog 05c14bd
fix for regamedll
Hedgefog 07e1a8f
add player effects api
Hedgefog 078d6d4
update api
Hedgefog 86486d6
update entities
Hedgefog 3ae950c
update player effects constants
Hedgefog 1df9c98
add inheritance
Hedgefog fd564ba
particles api update
Hedgefog 5a87509
add images
Hedgefog 70bc080
add links
Hedgefog 62639ac
update docs
Hedgefog 56ca0d5
fix lang
Hedgefog 3118360
fix initialization
Hedgefog 481ab11
fix Nav_Area_GetClosestPointOnArea native
Hedgefog 027110d
add Nav_Path_Segment_GetArea method
Hedgefog 88339bb
add ladders support
Hedgefog b6153f4
update docs
Hedgefog 3a159d2
fix virtual methods
Hedgefog e0a4755
fix camera activation pvs
Hedgefog 21cf9f5
fix round end forward params
Hedgefog 16ba4b9
fix system cleaning
Hedgefog 14201e3
fix particle init
Hedgefog 1cf689e
add cellclass util
Hedgefog 886de02
update custom entities api
Hedgefog b9bf7da
optimizations
Hedgefog 9390084
update fire entity
Hedgefog 03481b1
fix const include
Hedgefog eb5c1dd
small fixes
Hedgefog 7bffa84
fix model update
Hedgefog dc62542
fix fire bounding box
Hedgefog 09e0f57
fix path positions compute
Hedgefog b10fccf
add entity selection api
Hedgefog 97eae5a
add readme
Hedgefog ab1d04a
add animated demonstration
Hedgefog 9d7f6b0
update selection api
Hedgefog 7b4ed83
update readme
Hedgefog c9023c5
add cursor entity support
Hedgefog 9306acb
add SetCursorPos native
Hedgefog f63edec
optimize cellclass performance
Hedgefog ea2d496
add setters and getters
Hedgefog 29eec3a
add abstract entities
Hedgefog 0971ba5
add base npc entity
Hedgefog 9ce3f7c
fix priority
Hedgefog cc0f142
fix cursor pos native
Hedgefog ac0524e
improve npc logic
Hedgefog c97cd77
improve attack logic
Hedgefog d191d44
fix movement
Hedgefog 0a578e7
update custom entities api
Hedgefog 706ca16
add debug logging
Hedgefog 708487d
add Nav_Path_FindTask_Await native
Hedgefog 9f7e9d0
add WIP base monster entity
Hedgefog 5626e1a
improve cellclass performance
Hedgefog e8e2fa4
add cache
Hedgefog 06f528c
remove debug line
Hedgefog 007c846
update for new cellclass version
Hedgefog f214600
improve await
Hedgefog df2cb25
migration to function pointers
Hedgefog 51eefc3
fix check for function id
Hedgefog 9c9ea75
update is_pfunc_local stock
Hedgefog ddfccba
fix return
Hedgefog dc88a49
fix buffer position
Hedgefog 7388d94
optimizations
Hedgefog 39bace7
small optimizations
Hedgefog d2e5e14
fix pointers range
Hedgefog 1698891
update navsystem
Hedgefog 081a5e5
fix native params
Hedgefog 1227501
add example for monster_base entity
Hedgefog 43dd927
add readme
Hedgefog 4df22c7
update readme
Hedgefog 738c7ea
update readme
Hedgefog d88c8ed
update readme
Hedgefog 90b74b7
add PlayerModel_UpdateAnimation native
Hedgefog d334f5d
update readme
Hedgefog f4d5846
add future version
Hedgefog ba61323
update future readme
Hedgefog 7e063df
update future doc
Hedgefog badace8
add doc for custom methods
Hedgefog 72a3053
update cautions
Hedgefog d10d908
fix title
Hedgefog 153d601
update syntax highlight
Hedgefog b515261
update methods example
Hedgefog cf38cca
update file names for future
Hedgefog 9e487de
update util
Hedgefog eadc489
optimizations
Hedgefog c82c94a
fix allocate params + strict calls
Hedgefog 058e22e
optimizations
Hedgefog 7bfaacd
fix natives
Hedgefog 5d63377
add ref types + fix setters/getters
Hedgefog 3369ab8
add push forward
Hedgefog 3e39e72
fix model user info exploit
Hedgefog 4fda53e
add states api
Hedgefog 0be3c3f
fix eol
Hedgefog 3b7b0c4
add State_Manager_GetTransitionProgress native
Hedgefog fe14de2
add guards
Hedgefog e509ac9
Update README.md
Hedgefog 402baaa
fix context id
Hedgefog 581d976
fix state change processing during hooks call
Hedgefog File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
## 🛠️ Modding Kit 🇺🇦 | ||
|
||
### 📄 About | ||
__CS Modding Kit__ is a powerful solutions for Amx Mod X modding that can be used to create complex mods for a short time with flexible solutions using a unified development approach. I continue working on this repository and plan many new solutions in the future as well as move my mods to this solution to create examples and a good code base. Focus on game logic instead of crutches for native stuff. | ||
|
||
### ❔Why Modding Kit? | ||
- Powerful, rasy to use and flexible game systems | ||
- Unified system easy to maintain | ||
- Cross-game development (you can create mods that will work with both **Counter-Strike** and **Half-Life**) | ||
|
||
### 🔽 Download latest: | ||
- [Releases](./releases) | ||
|
||
### 🔄 Requirements | ||
- Amx Mod X 1.9+ | ||
- RegameDLL + ReAPI (for some APIs) | ||
|
||
### ⚙️ Available APIs | ||
- [🫸 Advanced Pushing](./api/advanced-pushing) | ||
- [🧸 Custom Entities](./api/custom-entities) | ||
- [🔄 Custom Events](./api/custom-events) | ||
- [🔫 Custom Weapons](./api/custom-weapons) | ||
- [🎯 NavSystem](./api/navsystem) | ||
- [💫 Particles](./api/particles) | ||
- [🎥 Player Camera](./api/player-camera) | ||
- [🎩 Player Cosmetics](./api/player-cosmetics) | ||
- [🥴 Player Dizziness](./api/player-dizziness) | ||
- [🏃♂️ Player Effects](./api/player-effects) | ||
- [🎒 Player Inventory](./api/player-inventory) | ||
- [🦸 Player Model](./api/player-model) | ||
- [👁️ Player Viewrange](./api/player-viewrange) | ||
- [⏱️ Rounds](./api/rounds) | ||
- [❓ Waypoint Markers](./api/waypoint-markers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,229 @@ | ||
#pragma semicolon 1 | ||
|
||
#include <amxmodx> | ||
#include <hamsandwich> | ||
#include <fakemeta> | ||
#include <xs> | ||
|
||
#include <api_advanced_pushing> | ||
|
||
#define PLAYER_PREVENT_CLIMB (1<<5) | ||
|
||
#define IS_PLAYER(%1) (%1 >= 1 && %1 <= MaxClients) | ||
|
||
new Float:g_flPlayerReleaseClimbBlock[MAX_PLAYERS + 1]; | ||
|
||
public plugin_init() { | ||
register_plugin("[API] Advanced Pushing", "1.0.0", "Hedgehog Fog"); | ||
|
||
RegisterHamPlayer(Ham_Spawn, "HamHook_Player_Spawn_Post", .Post = 1); | ||
RegisterHamPlayer(Ham_Player_PostThink, "HamHook_Player_PostThink_Post", .Post = 1); | ||
} | ||
|
||
public plugin_natives() { | ||
register_library("api_advanced_pushing"); | ||
register_native("APS_Push", "Native_Push"); | ||
register_native("APS_PushFromOrigin", "Native_PushFromOrigin"); | ||
register_native("APS_PushFromBBox", "Native_PushFromBBox"); | ||
} | ||
|
||
public Native_Push(iPluginId, iArgc) { | ||
new pEntity = get_param(1); | ||
new Float:vecForce[3]; get_array_f(2, vecForce, sizeof(vecForce)); | ||
new APS_Flags:iFlags = APS_Flags:get_param(3); | ||
@Base_Push(pEntity, vecForce, iFlags); | ||
} | ||
|
||
public Native_PushFromOrigin(iPluginId, iArgc) { | ||
new pEntity = get_param(1); | ||
new Float:flForce = get_param_f(2); | ||
new Float:vecPushOrigin[3]; get_array_f(3, vecPushOrigin, sizeof(vecPushOrigin)); | ||
new APS_Flags:iFlags = APS_Flags:get_param(4); | ||
|
||
@Base_PushFromOrigin(pEntity, flForce, vecPushOrigin, iFlags); | ||
} | ||
|
||
public Native_PushFromBBox(iPluginId, iArgc) { | ||
new pEntity = get_param(1); | ||
new Float:flForce = get_param_f(2); | ||
new Float:vecAbsMin[3]; get_array_f(3, vecAbsMin, sizeof(vecAbsMin)); | ||
new Float:vecAbsMax[3]; get_array_f(4, vecAbsMax, sizeof(vecAbsMax)); | ||
new Float:flMinDepthRatio = get_param_f(5); | ||
new Float:flMaxDepthRatio = get_param_f(6); | ||
new Float:flDepthInfluenceMin = get_param_f(7); | ||
new Float:flDepthInfluenceMax = get_param_f(8); | ||
new APS_Flags:iFlags = APS_Flags:get_param(9); | ||
|
||
@Base_PushFromBBox(pEntity, flForce, vecAbsMin, vecAbsMax, flMinDepthRatio, flMaxDepthRatio, flDepthInfluenceMin, flDepthInfluenceMax, iFlags); | ||
} | ||
|
||
public HamHook_Player_Spawn_Post(pPlayer) { | ||
@Player_ReleaseClimbPrevention(pPlayer); | ||
} | ||
|
||
public HamHook_Player_PostThink_Post(pPlayer) { | ||
if (g_flPlayerReleaseClimbBlock[pPlayer] && g_flPlayerReleaseClimbBlock[pPlayer] <= get_gametime()) { | ||
@Player_ReleaseClimbPrevention(pPlayer); | ||
} | ||
} | ||
|
||
@Player_SetClimbPrevention(pPlayer, bool:bValue) { | ||
new iPlayerFlags = pev(pPlayer, pev_iuser3); | ||
|
||
if (bValue) { | ||
iPlayerFlags |= PLAYER_PREVENT_CLIMB; | ||
} else { | ||
iPlayerFlags &= ~PLAYER_PREVENT_CLIMB; | ||
} | ||
|
||
set_pev(pPlayer, pev_iuser3, iPlayerFlags); | ||
} | ||
|
||
@Player_ReleaseClimbPrevention(this) { | ||
if (g_flPlayerReleaseClimbBlock[this]) { | ||
@Player_SetClimbPrevention(this, false); | ||
g_flPlayerReleaseClimbBlock[this] = 0.0; | ||
} | ||
} | ||
|
||
@Base_Push(this, const Float:vecForce[3], APS_Flags:iFlags) { | ||
static Float:vecVelocity[3]; pev(this, pev_velocity, vecVelocity); | ||
|
||
if (iFlags & APS_Flag_AddForce) { | ||
xs_vec_add(vecVelocity, vecForce, vecVelocity); | ||
} else { | ||
for (new i = 0; i < 3; ++i) { | ||
if (iFlags & APS_Flag_OverlapMode) { | ||
vecVelocity[i] = vecForce[i] ? vecForce[i] : vecVelocity[i]; | ||
} else { | ||
vecVelocity[i] = vecForce[i]; | ||
} | ||
} | ||
} | ||
|
||
set_pev(this, pev_velocity, vecVelocity); | ||
|
||
if (IS_PLAYER(this) && ~pev(this, pev_iuser3) & PLAYER_PREVENT_CLIMB) { | ||
@Player_SetClimbPrevention(this, true); | ||
g_flPlayerReleaseClimbBlock[this] = get_gametime() + 0.1; | ||
} | ||
} | ||
|
||
@Base_PushFromOrigin(this, Float:flForce, Float:vecPushOrigin[3], APS_Flags:iFlags) { | ||
static Float:vecOrigin[3]; pev(this, pev_origin, vecOrigin); | ||
|
||
static Float:vecForce[3]; | ||
xs_vec_sub(vecOrigin, vecPushOrigin, vecForce); | ||
xs_vec_normalize(vecForce, vecForce); | ||
xs_vec_mul_scalar(vecForce, flForce, vecForce); | ||
|
||
@Base_Push(this, vecForce, iFlags); | ||
} | ||
|
||
@Base_PushFromBBox( | ||
this, | ||
Float:flForce, | ||
const Float:vecAbsMin[3], | ||
const Float:vecAbsMax[3], | ||
Float:flMinDepthRatio, | ||
Float:flMaxDepthRatio, | ||
Float:flDepthInfluenceMin, | ||
Float:flDepthInfluenceMax, | ||
APS_Flags:iFlags | ||
) { | ||
static Float:vecOrigin[3]; pev(this, pev_origin, vecOrigin); | ||
static Float:vecToucherAbsMin[3]; pev(this, pev_absmin, vecToucherAbsMin); | ||
static Float:vecToucherAbsMax[3]; pev(this, pev_absmax, vecToucherAbsMax); | ||
|
||
// Find and check intersection point | ||
for (new iAxis = 0; iAxis < 3; ++iAxis) { | ||
if (vecOrigin[iAxis] < vecAbsMin[iAxis]) { | ||
vecOrigin[iAxis] = vecToucherAbsMax[iAxis]; | ||
} else if (vecOrigin[iAxis] > vecAbsMax[iAxis]) { | ||
vecOrigin[iAxis] = vecToucherAbsMin[iAxis]; | ||
} | ||
|
||
if (vecAbsMin[iAxis] >= vecOrigin[iAxis]) return; | ||
if (vecAbsMax[iAxis] <= vecOrigin[iAxis]) return; | ||
} | ||
|
||
new iClosestAxis = -1; | ||
new pTrace = create_tr2(); | ||
static Float:vecOffset[3]; xs_vec_copy(Float:{0.0, 0.0, 0.0}, vecOffset); | ||
|
||
for (new iAxis = 0; iAxis < 3; ++iAxis) { | ||
// Calculates the toucher's offset relative to the current axis | ||
static Float:flSideOffsets[2]; | ||
flSideOffsets[0] = vecAbsMin[iAxis] - vecOrigin[iAxis]; | ||
flSideOffsets[1] = vecAbsMax[iAxis] - vecOrigin[iAxis]; | ||
|
||
if (iAxis == 2 && iClosestAxis != -1) { | ||
break; | ||
} | ||
|
||
for (new side = 0; side < 2; ++side) { | ||
// Check exit from current side | ||
static Float:vecTarget[3]; | ||
xs_vec_copy(vecOrigin, vecTarget); | ||
vecTarget[iAxis] += flSideOffsets[side]; | ||
engfunc(EngFunc_TraceMonsterHull, this, vecOrigin, vecTarget, IGNORE_MONSTERS | IGNORE_GLASS, this, pTrace); | ||
|
||
static Float:flFraction; | ||
get_tr2(pTrace, TR_flFraction, flFraction); | ||
|
||
// No exit, cannot push this way | ||
if (flFraction != 1.0) { | ||
flSideOffsets[side] = 0.0; | ||
} | ||
|
||
if (iAxis != 2) { | ||
// Save minimum offset, but ignore zero offsets | ||
if (!vecOffset[iAxis] || (flSideOffsets[side] && floatabs(flSideOffsets[side]) < floatabs(vecOffset[iAxis]))) { | ||
vecOffset[iAxis] = flSideOffsets[side]; | ||
} | ||
} else { | ||
// Priority on bottom side | ||
if (flSideOffsets[0]) { | ||
vecOffset[iAxis] = flSideOffsets[0]; | ||
} | ||
} | ||
|
||
// Find closest axis to push | ||
if (vecOffset[iAxis]) { | ||
if (iClosestAxis == -1 || floatabs(vecOffset[iAxis]) < floatabs(vecOffset[iClosestAxis])) { | ||
iClosestAxis = iAxis; | ||
} | ||
} | ||
} | ||
} | ||
|
||
free_tr2(pTrace); | ||
|
||
// Push by closest axis | ||
if (iClosestAxis == -1) return; | ||
|
||
static iPushDir; iPushDir = vecOffset[iClosestAxis] > 0.0 ? 1 : -1; | ||
static Float:vecSize[3]; xs_vec_sub(vecAbsMax, vecAbsMin, vecSize); | ||
static Float:flDepthRatio; flDepthRatio = floatabs(vecOffset[iClosestAxis]) / (vecSize[iClosestAxis] / 2); | ||
|
||
flDepthRatio = floatclamp(flDepthRatio, flMinDepthRatio, flMaxDepthRatio); | ||
|
||
static Float:vecForce[3]; xs_vec_copy(Float:{0.0, 0.0, 0.0}, vecForce); | ||
|
||
static bool:bInInfluence; bInInfluence = ( | ||
flDepthRatio >= flDepthInfluenceMin && | ||
flDepthRatio <= flDepthInfluenceMax | ||
); | ||
|
||
if (bInInfluence) { | ||
vecForce[iClosestAxis] = flForce * flDepthRatio * iPushDir; | ||
} else { | ||
vecForce[iClosestAxis] = flForce * iPushDir; | ||
|
||
if (iFlags & APS_Flag_AddForceInfluenceMode) { | ||
iFlags &= ~APS_Flag_AddForce; | ||
} | ||
} | ||
|
||
@Base_Push(this, vecForce, iFlags); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#if defined _api_advanced_pushing_included | ||
#endinput | ||
#endif | ||
#define _api_advanced_pushing_included | ||
|
||
#pragma reqlib api_advanced_pushing | ||
|
||
enum APS_Flags (<<=1) { | ||
APS_Flag_None, | ||
APS_Flag_AddForce = 1, | ||
APS_Flag_AddForceInfluenceMode, | ||
APS_Flag_OverlapMode | ||
}; | ||
|
||
/** | ||
* Pushes the entity using the given force vector. | ||
* | ||
* @param pEntity The entity to push. | ||
* @param vecForce The force vector to apply. | ||
* @param iFlags The flags for the push operation. | ||
* | ||
* @noreturn | ||
*/ | ||
native APS_Push(pEntity, const Float:vecForce[3], APS_Flags:iFlags = APS_Flag_None); | ||
|
||
/** | ||
* Pushes the entity from a specified origin with a force magnitude. | ||
* | ||
* @param pEntity The entity to push. | ||
* @param flForce The force magnitude to apply. | ||
* @param vecOrigin The origin point of the push. | ||
* @param iFlags The flags for the push operation. | ||
* | ||
* @noreturn | ||
*/ | ||
native APS_PushFromOrigin(pEntity, Float:flForce, Float:vecOrigin[3], APS_Flags:iFlags = APS_Flag_None); | ||
|
||
/** | ||
* Pushes the entity using a bounding box as the toucher. | ||
* | ||
* @param pEntity The entity to push. | ||
* @param flForce The force magnitude to apply. | ||
* @param vecAbsMin The absolute minimum point of the bounding box. | ||
* @param vecAbsMax The absolute maximum point of the bounding box. | ||
* @param flMinDepthRatio The minimum depth ratio for depth influence. | ||
* @param flMaxDepthRatio The maximum depth ratio for depth influence. | ||
* @param flDepthInfluenceMin The minimum depth influence. | ||
* @param flDepthInfluenceMax The maximum depth influence. | ||
* @param iFlags The flags for the push operation. | ||
* | ||
* @noreturn | ||
*/ | ||
native APS_PushFromBBox( | ||
pEntity, | ||
Float:flForce, | ||
const Float:vecAbsMin[3], | ||
const Float:vecAbsMax[3], | ||
Float:flMinDepthRatio = 0.0, | ||
Float:flMaxDepthRatio = 1.0, | ||
Float:flDepthInfluenceMin = 0.0, | ||
Float:flDepthInfluenceMax = 1.0, | ||
APS_Flags:iFlags = APS_Flag_None | ||
); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
easy*