908 Commits

Author SHA1 Message Date
Wikot235
99c94f058b Added more customizability 2025-01-06 16:54:54 +01:00
Wikot235
959af0b130 m_iMeleeReach now defaults to 55 2025-01-05 16:13:16 +01:00
Blixibon
7b15e43302
Merge pull request #324 from SirYodaJedi/master
Don't network info_null/func_null
2025-01-05 08:14:27 -06:00
Blixibon
de598346da
Merge pull request #332 from samisalreadytaken/fix-oob
Fix OOB access
2025-01-04 08:50:13 -06:00
Blixibon
a8d69e56e3
Merge pull request #264 from Petercov/mapbase-feature/vgui-screens
Outputs for vgui_screen
2025-01-04 08:48:37 -06:00
Blixibon
e0967dea69
Merge pull request #294 from azzyr/patch-1
Fix vertex blend swapping in Hammer for SDK_LightmappedGeneric
2025-01-04 08:44:59 -06:00
Blixibon
e3ca25a9fc
Merge pull request #308 from Wikot235/Fix-BlurFilterY-uses-width-instead-of-height
Fixed BlurFilterY uses width instead of height
2025-01-04 08:44:19 -06:00
Blixibon
7da95edde1
Merge pull request #315 from Wikot235/Fix-Flare-Issue
Fixed issue #314 (Env_flare crash)
2025-01-04 08:43:54 -06:00
Blixibon
b51c5c3f86
Merge pull request #322 from z33ky/small-mapbase-fixes
Small mapbase fixes
2025-01-04 08:43:02 -06:00
celisej567
93bec9d7c0 Update particlemgr.cpp 2025-01-03 04:28:09 +03:00
celisej567
e5d30605d5 float NaN undefined behavour fix 2025-01-03 02:26:39 +03:00
Blixibon
0464bd7fd3
Merge pull request #309 from Blixibon/mapbase/feature/spotlight-ignore-solid
Spotlight "Ignore solid" keyvalue from MP branch
2025-01-02 08:37:00 -06:00
Blixibon
98816adacc
Merge pull request #301 from Blixibon/mapbase/feature/sky-camera-multi-saverestore-fix
Fix maps with multiple sky_cameras not using the correct sky_camera after loading a save
2025-01-02 08:36:03 -06:00
Blixibon
038c66ef58
Merge pull request #300 from Blixibon/mapbase/feature/chromatic-aberration-effect
Primitive chromatic aberration effect for env_screeneffect
2025-01-02 08:35:25 -06:00
ALLEN-PC\acj30
4efb50283d Fix "Fade Corpse" spawnflag on NPCs not applying to serverside ragdolls 2025-01-02 08:34:03 -06:00
ALLEN-PC\acj30
bdc34e4bad Fix autocubemap crashing when not in a level 2025-01-02 08:33:22 -06:00
Blixibon
da44d97951
Merge pull request #297 from Blixibon/mapbase/feature/useable-ragdolls
Add capability to +USE serverside ragdolls and toggle cleanup of individual ragdolls
2025-01-02 08:31:09 -06:00
ALLEN-PC\acj30
b59214ca72 Fix dynamic interactions using "their_" keyvalues always assuming separate sequence names 2025-01-02 08:29:48 -06:00
ALLEN-PC\acj30
e954f00f79 Fix antlions using wrong angles for dynamic interactions 2025-01-02 08:28:38 -06:00
ALLEN-PC\acj30
f5db760a66 Add raw scene file support to GetSceneDuration() 2025-01-02 08:28:06 -06:00
ALLEN-PC\acj30
b19f329d5f Fix ai_dynint_always_enabled bypassing misc. criteria 2025-01-02 08:27:21 -06:00
Blixibon
72bd5fe948
Merge pull request #266 from rlenhub/develop
Implement "OnPhysGunPull" output in CPhysicsProp
2025-01-02 08:26:35 -06:00
Wikot235
47aa8ac3f4 Update triggers.cpp 2024-11-25 22:16:57 +01:00
samisalreadytaken
7ebb26c996 Fix OOB access on CBaseCombatCharacter::m_hMyWeapons 2024-11-22 16:38:36 +03:00
samisalreadytaken
3aad0f5245 Cleanup SquirrelVM saverestore 2024-11-21 17:24:48 +03:00
Alexander 'z33ky' Hirsch
6297d2b552 Fix ScriptHook_t initialization order
When a ScriptClassDesc_t for is initialized (SCRIPTDESC), it recursively
invokes its parents initializers in order to obtain their pHelper
member.
Initialization is only done once, so repeated initialization is skipped.
Initialization includes assignment of a vector of ScriptHook_t's
(DEFINE_SCRIPTFUNC/BEGIN_SCRIPTHOOK), which must be initialized
beforehand.
Both of these use (static) globals; Within a translation unit,
initialization order is defined to be the same as the order of
declaration. So within a translation unit we must define all
ScriptHook_t's before the ScriptClassDesc_t using them.
A problem occurs with the parent initialization though, since there is
no defined order between translation units, meaning initialization of a
ScriptClassDesc_t can happen before its ScriptHook_t's, despite being
the correct order within its translation unit.

On MSVC it seems this issue is benign. On GCC/Linux however the
initialization of a ScriptHook_t essentially cleared whatever happened
during the initialization of the ScriptClassDesc_t, meaning many hooks
simply didn't work.

This situation is remedied by delaying the initialization of the
ScriptClassDesc_t's ScriptHook_t vector to only when the constructor of
it is invoked from its translation unit. This is accomplished simply by
adding a boolean parameter to the function (GetScriptDesc()) that is
true in the global constructor invocation, and false by default
(including when doing parent ScriptClassDesc_t initialization).
When false, a valid ScriptClassDesc_t pointer is still returned, which
is all that is needed for the initialization of the child
ScriptClassDesc_t. The value of the returned pointer is a fixed memory
location, and does not change due to the delayed initialization.
The script-helper must be initialized eagerly though, for the search of
a base-class helper. This also changes the SCRIPTDESC slightly to
accommodate the eager initialization of helper instance pointer.

Fixes #244.
2024-11-20 23:02:00 +01:00
Alexander 'z33ky' Hirsch
7d78384b26 Fix scriptanimevent_t::SetOption()
The string argument refers to memory managed by the Squirrel VM. It has
no guarantee that the string will continue to exist after the hook, from
which this can be called, has finished executing.
To fix this, allocate memory to copy the string into and manage it as
needed.
2024-11-19 13:26:59 +01:00
Alexander 'z33ky' Hirsch
8e8bdfc371 Optimize void return in squirrel function call stub 2024-11-19 13:26:58 +01:00
Alexander 'z33ky' Hirsch
1ecaa44c49 Release ScriptVariant_t memory in all paths of squirrel function stubs 2024-11-19 13:26:56 +01:00
Alexander 'z33ky' Hirsch
c0e12a2f58 Add type check for script helper assignments from ScriptVariant_t 2024-11-19 13:26:23 +01:00
Alexander 'z33ky' Hirsch
cbb60e1afd Remove VScript Squrrel arithmetic operator helper
They were broken, and only add for Quaternions was implemented, for
which there is a working QuaternionAdd() script function instead.
Fixing it seems like unnecessary work.
2024-11-19 13:26:22 +01:00
Alexander 'z33ky' Hirsch
a2e43a567f Fix (potential?) memory leaks from getVariant() (SquirrelVM)
Free values before assignment.
2024-11-19 13:26:22 +01:00
Alexander 'z33ky' Hirsch
fe82da8f1b Remove unused generic ScriptVariant_t::{Get,AssignTo}()
They wouldn't even work.
2024-11-19 13:26:22 +01:00
Alexander 'z33ky' Hirsch
99858e63f7 Optimize squirrel function_stub() Vector/QAngle return value
Instead of temporary allocating dynamic memory, which subsequently is
copied into another dynamically allocated piece of memory, provide a
temporary buffer on the stack.
The script value inserted into the VM still needs to allocate
dynamically though...

A few sites are adapted to not create a ScriptVariant_t from a temporary
Vector to avoid dynamic allocation there too.

cf. mapbase-source/source-sdk-2013#321
2024-11-19 13:26:19 +01:00
Alexander 'z33ky' Hirsch
879b9e8d25 Fix dubious ScriptVariant_t Free()'s
When assigning a null value in getVariant(), make sure a previous
SV_FREE is not carried over.

In SqurrelVM::ReleaseValue(), make sure SV_FREE is not kept after
Free()ing a value.
2024-11-15 15:38:09 +01:00
Alexander 'z33ky' Hirsch
80f19601ee "Fix" ScriptVariant_t::Free()
Type FIELD_HSCRIPT is removed, it never sets SV_FREE.

All dynamic memory is now free`d via free(). For strdup(), this would be
the conformant way in standard C++. It matters not in Source, since both
use the same global allocator of the engine, but it is tidier.
Vector and QAngle are now allocated via malloc() instead of new to
provide symmetry.
2024-11-15 15:38:08 +01:00
Alexander 'z33ky' Hirsch
696036219e Prevent signed overflow (UB) in SquirrelVM::GenerateUniqueKey() 2024-11-13 00:25:51 +01:00
Yui
337b58eb3c
Don't network info_null
Reduces potential for entity limit crashes, as it still exists for the first tick.
2024-09-09 10:33:07 -04:00
samisalreadytaken
ead5668dc8 Fix GetPropVector return type 2024-09-07 16:42:37 +03:00
Alexander 'z33ky' Hirsch
359fcb7196 Ditch attempts trying to obtain sound duration of MP3s
Crashes on Linux. Apparently returns incorrect values on Windows.
2024-09-05 23:45:20 +02:00
Alexander 'z33ky' Hirsch
a999c794f7 Fix minor case of const-correctness 2024-09-05 23:44:50 +02:00
Alexander 'z33ky' Hirsch
df6adcc5e9 Fix -Wdelete-incomplete in CDefaultCustomWeaponEntityFactory::ReleaseData()
GCC warns about attempting to delete a void-pointer, since it will not
be able to invoke its destructor. Fix by casing it to the expected
type.
2024-09-05 23:42:16 +02:00
Alexander 'z33ky' Hirsch
e9c45e5235 Implement GetColorForSurface() failure workaround
This function is used to color impact particles.
On Linux I've noticed that this function sometimes is not successful on
retrieving the surface color, leaving an odd color to render the
particles with. The engine function TraceLineMaterialAndLighting() even
has a boolean return value indicating success.
GetModelMaterialColorAndLighting() does not though, but I still observe
failures (the color parameter is not modified). The color is initialized
with an invalid value. If it detects that retrieving the color failed
(engine function said so or the invalid value was left in place), this
now hamfistedly assumes a lightish grey color, but at least still
correctly (presumably) incorporates lighting information.
When this situation is detected, a warning is also printed to the
console. Because why not.
2024-09-05 23:35:46 +02:00
Alexander 'z33ky' Hirsch
c9dd357470 Prevent return of dangling Vector/QAngle to VScript
When a Vector or QAngle rvalue reference is returned from a VScript
function, the constructed ScriptVariant_t must not store the pointer to
it since it is, per convention, a temporary reference. Only do that for
lvalue-references, but do a copy when constructing from or assigning a
rvalue reference.
2024-09-05 23:24:06 +02:00
ALLEN-PC\acj30
309f8019dd Choreography-driven sentence system 2024-08-31 16:13:09 -05:00
ALLEN-PC\acj30
5d50335c02 New "Destroy" input for func_combine_ball_spawner 2024-08-10 13:51:06 -05:00
ALLEN-PC\acj30
102c7c3015 New "StopActionLoop" input for scripted_sequence 2024-08-10 13:49:19 -05:00
ALLEN-PC\acj30
06596695a3 Fix filter_activator_model issues with save/restore and null activator 2024-08-10 13:48:48 -05:00
ALLEN-PC\acj30
178a262032 Add VScript function for checking last hit group on CBaseCombatCharacter 2024-08-10 13:47:53 -05:00
Wikot235
4f14f0c5cc Fixed the issue. 2024-08-07 13:16:37 +02:00