wiremod / advdupe2

Advanced Duplicator 2
http://wiremod.com
Apache License 2.0
90 stars 60 forks source link

Properly clamp inputs #459

Closed wrefgtzweve closed 8 months ago

wrefgtzweve commented 9 months ago

Properly clamps input vectors and angles to prevent abuse

thegrb93 commented 9 months ago

The only thing that advdupe2 should clamp is position/rotation of pasted entities. I think it already does that.

wrefgtzweve commented 9 months ago

It currently isn't being clamped in DoGenericPhysics, CreateConstraintFromTable and CreateEntityFromTable which can all be abused for instant crazy physics crashes. The reason i chose the full recursive logic is to prevent any future possible abuse. I chose 10000 as i was able to trigger crazyphysics with relatively low values such as 15000.

thegrb93 commented 9 months ago

The problem with clamping it everywhere is you're bound to break some dupes with that. We should just clamp pos and angle.

thegrb93 commented 9 months ago

This might fuck up pasting near the edge of big maps. Need to test.

thegrb93 commented 8 months ago

The size of gm_flatgrass extends to 15359.968750. I think the limit will need to be 16384

wrefgtzweve commented 8 months ago

Yeah im not sure how to handle that yet, if i remember correctly source maps can be 32k x 32k however even a limit of 16k causes crazyphysics.