bug with reflection fixed (#19127)
* bug with reflection fixed * check for pockets added
This commit is contained in:
@@ -174,8 +174,10 @@ public abstract class SharedReflectSystem : EntitySystem
|
|||||||
if (!TryComp(args.Equipee, out ReflectComponent? reflection))
|
if (!TryComp(args.Equipee, out ReflectComponent? reflection))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
reflection.Enabled = true;
|
if (args.Slot == "pocket1" || args.Slot == "pocket2")
|
||||||
|
return;
|
||||||
|
|
||||||
|
reflection.Enabled = comp.Enabled;
|
||||||
// reflection probability should be: (1 - old probability) * newly-equipped item probability + old probability
|
// reflection probability should be: (1 - old probability) * newly-equipped item probability + old probability
|
||||||
// example: if entity has .25 reflection and newly-equipped item has .7, entity should have (1 - .25) * .7 + .25 = .775
|
// example: if entity has .25 reflection and newly-equipped item has .7, entity should have (1 - .25) * .7 + .25 = .775
|
||||||
reflection.ReflectProb += (1 - reflection.ReflectProb) * comp.ReflectProb;
|
reflection.ReflectProb += (1 - reflection.ReflectProb) * comp.ReflectProb;
|
||||||
|
|||||||
Reference in New Issue
Block a user