Facepunch / garrysmod-issues

Garry's Mod issue tracker
144 stars 56 forks source link

SetSubMaterial fills up NetworkStrings with material names #4778

Closed jadeharley2 closed 3 years ago

jadeharley2 commented 3 years ago

Details

ENTITY:SetSubMaterial(id, material) called on server adds new NetworkString with material name as value. This can create a lot of NetworkStrings and fill up their limit. Also it does so without calling util.AddNetworkString function. garrysmod version: 2020.12.11

Steps to reproduce

  1. set sub material lua_run Entity(1):SetSubMaterial(1, "anything")

  2. list networkstrings lua_run for k=0, 3000 do local v = util.NetworkIDToString( k ) if v then MsgN(" - ",v) end end

  3. at the end of the list this will appear: - anything

WilliamVenner commented 3 years ago

This makes it difficult to create dynamic textures on the client and reliably set them on entities.

robotboy655 commented 3 years ago

It is not a bug.

robotboy655 commented 3 years ago

Related issues: https://github.com/Facepunch/garrysmod-requests/issues/1741, https://github.com/Facepunch/garrysmod-issues/issues/3362

thegrb93 commented 3 years ago

Is SetSubMaterial actually consuming network string ids or is it an addon?

robotboy655 commented 3 years ago

It is Set(Sub)Material, it networks IDs, not strings.