sourcemod icon indicating copy to clipboard operation
sourcemod copied to clipboard

Effects are not attached to the player

Open xMaZax opened this issue 7 years ago • 9 comments

After this update, the effects are no longer attached to the player. (For example neon under the player or partikly around the player)

https://github.com/alliedmodders/sourcemod/commit/e2eac382c056bc1d8ee435421afb34c

xMaZax avatar May 03 '19 08:05 xMaZax

What is making you think that this might be an issue in / caused by SourceMod?

asherkin avatar May 03 '19 11:05 asherkin

Because I compiled a version of 6395 and everything was fine but after I compiled the version 6396 then the problems started. These problems are all serverdirectory.

xMaZax avatar May 03 '19 12:05 xMaZax

This problem is SetVariant Functions not working. https://forums.alliedmods.net/showthread.php?t=315948

Zeisenx avatar May 03 '19 15:05 Zeisenx

Not sure exactly whats going on here, SetVariant wasn't directly modified in that commit, and others look fine.

Headline avatar May 03 '19 20:05 Headline

Not sure exactly whats going on here, SetVariant wasn't directly modified in that commit, and others look fine.

I was wondering if the decltype in AcceptInput (which is where it would really matter) is somehow getting the wrong size.

asherkin avatar May 03 '19 21:05 asherkin

That’s entirely possible, but also quite frustrating

Headline avatar May 03 '19 21:05 Headline

The constructor in ArgBuffer is automatically setting the sizes depending on the types, you probably didn't notice a big difference in other natives using it because most of the types are 4 bytes in size, or less... but for hard coded structs like the variant_t. a solution would be to make the ArgBuffer constructor also accepts size as parameter, which is.. not very pretty most of the time, or just do a little hack:

In variant-t.h:

struct FakeVariant_s
{
    unsigned char dummy[SIZEOF_VARIANT_T];
}

and changing the line here: https://github.com/alliedmodders/sourcemod/blob/e2eac382c056bc1d8ee435421afb34c28e4c0988/extensions/sdktools/inputnatives.cpp#L98

To: ArgBuffer<void*, const char*, CBaseEntity*, CBaseEntity*, FakeVariant_s, int> vstk(pDest, inputname, pActivator, pCaller, *(FakeVariant_s *) g_Variant_t, params[5]);

TheDS1337 avatar May 04 '19 01:05 TheDS1337

Thank you very much, I'm still 98% sure this is a linker error and SM_ARRAYSIZE would cover this :-)

KyleSanderson avatar May 04 '19 01:05 KyleSanderson

Fixed in #999, feel free to reopen if this still occurs

Headline avatar May 04 '19 08:05 Headline