Skip to content

[BUG]: Dummies set to noclip disappear from clients #244

@xCynDev

Description

@xCynDev

Before You Report

  • I have searched for existing reports of this bug, and this bug report is unique.

Version

14.1.3

Description

After a few hours of debugging SL's codebase, it turns out that dummies do not have a received position when noclipping (FpcMotor.ReceivedPosition) which causes them to vanish to 0 0 0 (probably, or invalid waypoint, who knows, can't debug the client that way cause no client stuff). Seems like sometimes they need to have noclip enabled/disabled a few times for that to show up.

Does not affect regular players. The fix for this is to assign the "received position" to whatever you want it to be, before calling ServerOverridePosition().

// fpcRole is Dummy's role.
if (Dummy.playerStats.GetModule<AdminFlagsStat>().HasFlag(AdminFlags.Noclip) || fpcRole.FpcModule.Noclip.RecentlyActive)
{
    fpcRole.FpcModule.Motor.ReceivedPosition = new RelativePosition(position);
}
fpcRole.FpcModule.ServerOverridePosition(position);  

To Reproduce

  • Set a dummy to noclip (enable the flag in AdminFlagsStat)
  • Move them a little
  • Toggle the flag off and on again if it didn't work
  • See them vanish.

Expected Behavior

  • They don't vanish.

Additional Information

Worked prior to 14.1.3

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions