@quenty/ragdoll 15.64.2 → 15.65.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/package.json +34 -32
- package/src/Server/Cmdr/RagdollCmdrService.lua +136 -0
- package/src/Server/Cmdr/RagdollCmdrService.spec.lua +189 -0
- package/src/Server/RagdollService.lua +2 -0
- package/src/Shared/Rigging/RagdollBallSocketUtils.lua +1 -1
- package/src/Shared/Rigging/RagdollMotorUtils.lua +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [15.65.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/ragdoll@15.65.0...@quenty/ragdoll@15.65.1) (2026-08-14)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **ragdoll:** Clean up previous motor state when ragdoll inputs change ([9731cf7](https://github.com/Quenty/NevermoreEngine/commit/9731cf70a88f3924a5232c21aacc0ffc40b61826))
|
|
11
|
+
|
|
12
|
+
# [15.65.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/ragdoll@15.64.2...@quenty/ragdoll@15.65.0) (2026-08-14)
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- **ragdoll:** add ragdoll and unragdoll cmdr commands ([#802](https://github.com/Quenty/NevermoreEngine/issues/802)) ([dd3d887](https://github.com/Quenty/NevermoreEngine/commit/dd3d887b920fe80cc21f86bd1eceb58f43ad0e00))
|
|
17
|
+
|
|
6
18
|
## [15.64.2](https://github.com/Quenty/NevermoreEngine/compare/@quenty/ragdoll@15.64.1...@quenty/ragdoll@15.64.2) (2026-08-12)
|
|
7
19
|
|
|
8
20
|
**Note:** Version bump only for package @quenty/ragdoll
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/ragdoll",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.65.1",
|
|
4
4
|
"description": "Quenty's Ragdoll system for Roblox - Floppy fun ragdolls",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -28,44 +28,46 @@
|
|
|
28
28
|
"Quenty"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@quenty/adorneedata": "7.41.
|
|
32
|
-
"@quenty/attributeutils": "14.36.
|
|
33
|
-
"@quenty/baseobject": "10.15.
|
|
34
|
-
"@quenty/binder": "14.43.
|
|
35
|
-
"@quenty/brio": "14.35.
|
|
36
|
-
"@quenty/camera": "14.51.
|
|
31
|
+
"@quenty/adorneedata": "7.41.1",
|
|
32
|
+
"@quenty/attributeutils": "14.36.1",
|
|
33
|
+
"@quenty/baseobject": "10.15.1",
|
|
34
|
+
"@quenty/binder": "14.43.2",
|
|
35
|
+
"@quenty/brio": "14.35.2",
|
|
36
|
+
"@quenty/camera": "14.51.1",
|
|
37
37
|
"@quenty/cancellabledelay": "3.6.2",
|
|
38
|
-
"@quenty/characterutils": "12.41.
|
|
39
|
-
"@quenty/
|
|
38
|
+
"@quenty/characterutils": "12.41.1",
|
|
39
|
+
"@quenty/cmdrservice": "13.57.1",
|
|
40
|
+
"@quenty/draw": "7.16.1",
|
|
40
41
|
"@quenty/enumutils": "3.4.6",
|
|
41
42
|
"@quenty/hapticfeedbackutils": "3.3.3",
|
|
42
|
-
"@quenty/instanceutils": "13.35.
|
|
43
|
-
"@quenty/loader": "10.11.
|
|
44
|
-
"@quenty/maid": "3.11.
|
|
45
|
-
"@quenty/motor6d": "7.52.
|
|
46
|
-
"@quenty/nevermore-test-runner": "1.5.
|
|
47
|
-
"@quenty/physicsutils": "8.33.
|
|
48
|
-
"@quenty/playerhumanoidbinder": "14.47.
|
|
49
|
-
"@quenty/playermock": "1.6.
|
|
50
|
-
"@quenty/
|
|
51
|
-
"@quenty/
|
|
52
|
-
"@quenty/
|
|
53
|
-
"@quenty/
|
|
54
|
-
"@quenty/
|
|
55
|
-
"@quenty/
|
|
56
|
-
"@quenty/
|
|
57
|
-
"@quenty/
|
|
58
|
-
"@quenty/
|
|
59
|
-
"@quenty/
|
|
60
|
-
"@quenty/
|
|
43
|
+
"@quenty/instanceutils": "13.35.2",
|
|
44
|
+
"@quenty/loader": "10.11.1",
|
|
45
|
+
"@quenty/maid": "3.11.1",
|
|
46
|
+
"@quenty/motor6d": "7.52.2",
|
|
47
|
+
"@quenty/nevermore-test-runner": "1.5.1",
|
|
48
|
+
"@quenty/physicsutils": "8.33.1",
|
|
49
|
+
"@quenty/playerhumanoidbinder": "14.47.1",
|
|
50
|
+
"@quenty/playermock": "1.6.1",
|
|
51
|
+
"@quenty/playerutils": "8.41.1",
|
|
52
|
+
"@quenty/promise": "10.23.1",
|
|
53
|
+
"@quenty/qframe": "10.31.1",
|
|
54
|
+
"@quenty/r15utils": "13.36.3",
|
|
55
|
+
"@quenty/remoting": "12.41.2",
|
|
56
|
+
"@quenty/rigbuilderutils": "10.43.1",
|
|
57
|
+
"@quenty/rx": "13.33.1",
|
|
58
|
+
"@quenty/rxbinderutils": "14.43.2",
|
|
59
|
+
"@quenty/rxsignal": "7.33.1",
|
|
60
|
+
"@quenty/servicebag": "11.20.1",
|
|
61
|
+
"@quenty/spring": "10.12.1",
|
|
62
|
+
"@quenty/steputils": "3.7.2",
|
|
61
63
|
"@quenty/table": "3.9.2",
|
|
62
|
-
"@quenty/tie": "10.47.
|
|
63
|
-
"@quenty/valuebaseutils": "13.35.
|
|
64
|
-
"@quenty/valueobject": "13.36.
|
|
64
|
+
"@quenty/tie": "10.47.1",
|
|
65
|
+
"@quenty/valuebaseutils": "13.35.2",
|
|
66
|
+
"@quenty/valueobject": "13.36.2",
|
|
65
67
|
"@quentystudios/jest-lua": "3.10.0-quenty.2"
|
|
66
68
|
},
|
|
67
69
|
"publishConfig": {
|
|
68
70
|
"access": "public"
|
|
69
71
|
},
|
|
70
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "f084360c3729ea424d49d9bc42f8f0d1c128fa82"
|
|
71
73
|
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
--!strict
|
|
2
|
+
--[=[
|
|
3
|
+
Ragdoll admin commands.
|
|
4
|
+
|
|
5
|
+
| Command | What it does |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| `ragdoll` | Ragdolls players |
|
|
8
|
+
| `unragdoll` | Takes players out of a ragdoll |
|
|
9
|
+
|
|
10
|
+
Both take a list of players, so `ragdoll *` reaches everyone in the server as readily as a single
|
|
11
|
+
username does, and both act on the humanoid of each player's current character. A player without
|
|
12
|
+
one is reported and skipped, so one dead or loading player never hides what happened to the rest.
|
|
13
|
+
|
|
14
|
+
@server
|
|
15
|
+
@class RagdollCmdrService
|
|
16
|
+
]=]
|
|
17
|
+
|
|
18
|
+
local require = require(script.Parent.loader).load(script)
|
|
19
|
+
|
|
20
|
+
local CharacterUtils = require("CharacterUtils")
|
|
21
|
+
local CmdrService = require("CmdrService")
|
|
22
|
+
local CmdrTypes = require("CmdrTypes")
|
|
23
|
+
local Maid = require("Maid")
|
|
24
|
+
local PlayerUtils = require("PlayerUtils")
|
|
25
|
+
local Ragdoll = require("Ragdoll")
|
|
26
|
+
local ServiceBag = require("ServiceBag")
|
|
27
|
+
|
|
28
|
+
local RagdollCmdrService = {}
|
|
29
|
+
RagdollCmdrService.ServiceName = "RagdollCmdrService"
|
|
30
|
+
|
|
31
|
+
type CommandContext = CmdrTypes.CommandContext
|
|
32
|
+
|
|
33
|
+
export type RagdollCmdrService = typeof(setmetatable(
|
|
34
|
+
{} :: {
|
|
35
|
+
_serviceBag: ServiceBag.ServiceBag,
|
|
36
|
+
_maid: Maid.Maid,
|
|
37
|
+
_cmdrService: any,
|
|
38
|
+
_ragdollBinder: typeof(Ragdoll),
|
|
39
|
+
},
|
|
40
|
+
{} :: typeof({ __index = RagdollCmdrService })
|
|
41
|
+
))
|
|
42
|
+
|
|
43
|
+
function RagdollCmdrService.Init(self: RagdollCmdrService, serviceBag: ServiceBag.ServiceBag): ()
|
|
44
|
+
assert(not (self :: any)._serviceBag, "Already initialized")
|
|
45
|
+
self._serviceBag = assert(serviceBag, "No serviceBag")
|
|
46
|
+
self._maid = Maid.new()
|
|
47
|
+
|
|
48
|
+
-- External
|
|
49
|
+
self._cmdrService = self._serviceBag:GetService(CmdrService)
|
|
50
|
+
|
|
51
|
+
-- Internal
|
|
52
|
+
self._ragdollBinder = self._serviceBag:GetService(Ragdoll)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
function RagdollCmdrService.Start(self: RagdollCmdrService): ()
|
|
56
|
+
self._maid:GivePromise(self._cmdrService:PromiseCmdr()):Then(function()
|
|
57
|
+
self:_registerCommands()
|
|
58
|
+
end)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
-- Shared so the "which players" argument reads the same in both commands.
|
|
62
|
+
local PLAYERS_ARG_DESCRIPTION = "Players to act on (e.g. . for yourself, * for everyone here, or a username)."
|
|
63
|
+
|
|
64
|
+
function RagdollCmdrService._registerCommands(self: RagdollCmdrService): ()
|
|
65
|
+
self._cmdrService:RegisterCommand({
|
|
66
|
+
Name = "ragdoll",
|
|
67
|
+
Description = "Ragdolls players. They stay ragdolled until unragdolled, unless the game unragdolls them itself (see UnragdollAutomatically).",
|
|
68
|
+
Group = "Ragdoll",
|
|
69
|
+
Args = {
|
|
70
|
+
{
|
|
71
|
+
Name = "Players",
|
|
72
|
+
Type = "players",
|
|
73
|
+
Description = PLAYERS_ARG_DESCRIPTION,
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
}, function(_context: CommandContext, players: { Player })
|
|
77
|
+
return self:_setRagdolled(players, true)
|
|
78
|
+
end)
|
|
79
|
+
|
|
80
|
+
self._cmdrService:RegisterCommand({
|
|
81
|
+
Name = "unragdoll",
|
|
82
|
+
Description = "Takes players out of a ragdoll, whether they were ragdolled by hand or by falling or dying.",
|
|
83
|
+
Group = "Ragdoll",
|
|
84
|
+
Args = {
|
|
85
|
+
{
|
|
86
|
+
Name = "Players",
|
|
87
|
+
Type = "players",
|
|
88
|
+
Description = PLAYERS_ARG_DESCRIPTION,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
}, function(_context: CommandContext, players: { Player })
|
|
92
|
+
return self:_setRagdolled(players, false)
|
|
93
|
+
end)
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
-- Reports a line per player, since the interesting cases (already ragdolled, no character) are
|
|
97
|
+
-- per-player and an admin running this on everyone still wants to see them.
|
|
98
|
+
function RagdollCmdrService._setRagdolled(self: RagdollCmdrService, players: { Player }, isRagdolled: boolean): string
|
|
99
|
+
if #players == 0 then
|
|
100
|
+
return "No players to act on."
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
local lines: { string } = {}
|
|
104
|
+
|
|
105
|
+
for _, player in players do
|
|
106
|
+
local name = PlayerUtils.formatName(player)
|
|
107
|
+
local humanoid = CharacterUtils.getPlayerHumanoid(player)
|
|
108
|
+
|
|
109
|
+
if not humanoid then
|
|
110
|
+
table.insert(lines, `{name} has no character.`)
|
|
111
|
+
continue
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
local wasRagdolled = self._ragdollBinder:Get(humanoid) ~= nil
|
|
115
|
+
if wasRagdolled == isRagdolled then
|
|
116
|
+
table.insert(lines, if isRagdolled then `{name} is already ragdolled.` else `{name} is not ragdolled.`)
|
|
117
|
+
continue
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if isRagdolled then
|
|
121
|
+
self._ragdollBinder:Bind(humanoid)
|
|
122
|
+
table.insert(lines, `Ragdolled {name}.`)
|
|
123
|
+
else
|
|
124
|
+
self._ragdollBinder:Unbind(humanoid)
|
|
125
|
+
table.insert(lines, `Unragdolled {name}.`)
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
return table.concat(lines, "\n")
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
function RagdollCmdrService.Destroy(self: RagdollCmdrService): ()
|
|
133
|
+
self._maid:DoCleaning()
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
return RagdollCmdrService
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
--!strict
|
|
2
|
+
--[[
|
|
3
|
+
Drives the command bodies against a mock player whose character is a local R6 rig. The service is
|
|
4
|
+
built by hand around a fake CmdrService, since the real one needs the Cmdr instance tree and a
|
|
5
|
+
running game -- what is worth checking here is that the commands move the public Ragdoll binder,
|
|
6
|
+
and that a player list is handled a player at a time.
|
|
7
|
+
|
|
8
|
+
Command bodies take the player array Cmdr's `players` type parses, so these pass one directly.
|
|
9
|
+
|
|
10
|
+
@class RagdollCmdrService.spec.lua
|
|
11
|
+
]]
|
|
12
|
+
|
|
13
|
+
local require = require(script.Parent.loader).load(script)
|
|
14
|
+
|
|
15
|
+
local Workspace = game:GetService("Workspace")
|
|
16
|
+
|
|
17
|
+
local Jest = require("Jest")
|
|
18
|
+
local Maid = require("Maid")
|
|
19
|
+
local PlayerMock = require("PlayerMock")
|
|
20
|
+
local PlayerMockService = require("PlayerMockService")
|
|
21
|
+
local Promise = require("Promise")
|
|
22
|
+
local Ragdoll = require("Ragdoll")
|
|
23
|
+
local RagdollCmdrService = require("RagdollCmdrService")
|
|
24
|
+
local RagdollService = require("RagdollService")
|
|
25
|
+
local RagdollTestUtils = require("RagdollTestUtils")
|
|
26
|
+
local Ragdollable = require("Ragdollable")
|
|
27
|
+
local RigBuilderUtils = require("RigBuilderUtils")
|
|
28
|
+
local ServiceBag = require("ServiceBag")
|
|
29
|
+
|
|
30
|
+
local describe = Jest.Globals.describe
|
|
31
|
+
local expect = Jest.Globals.expect
|
|
32
|
+
local it = Jest.Globals.it
|
|
33
|
+
|
|
34
|
+
local specCounter = 0
|
|
35
|
+
|
|
36
|
+
local function setup()
|
|
37
|
+
specCounter += 1
|
|
38
|
+
|
|
39
|
+
local maid = Maid.new()
|
|
40
|
+
|
|
41
|
+
local container = Instance.new("Folder")
|
|
42
|
+
container.Name = string.format("RagdollCmdrServiceSpecContainer_%d", specCounter)
|
|
43
|
+
container.Parent = Workspace
|
|
44
|
+
maid:GiveTask(container)
|
|
45
|
+
|
|
46
|
+
local serviceBag = maid:Add(ServiceBag.new())
|
|
47
|
+
serviceBag:GetService(RagdollService)
|
|
48
|
+
local playerMockService = serviceBag:GetService(PlayerMockService)
|
|
49
|
+
|
|
50
|
+
serviceBag:Init()
|
|
51
|
+
serviceBag:Start()
|
|
52
|
+
|
|
53
|
+
local registered: { [string]: (any, ...any) -> string } = {}
|
|
54
|
+
local cmdrService = {
|
|
55
|
+
RegisterCommand = function(_self, definition, execute)
|
|
56
|
+
registered[definition.Name] = execute
|
|
57
|
+
end,
|
|
58
|
+
PromiseCmdr = function()
|
|
59
|
+
return Promise.resolved({})
|
|
60
|
+
end,
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
-- Typed loosely: the fields are filled in by hand rather than by Init, so the table is not a
|
|
64
|
+
-- RagdollCmdrService until the last of them lands.
|
|
65
|
+
local service: any = setmetatable({}, { __index = RagdollCmdrService })
|
|
66
|
+
service._maid = Maid.new()
|
|
67
|
+
service._serviceBag = serviceBag
|
|
68
|
+
service._cmdrService = cmdrService
|
|
69
|
+
service._ragdollBinder = serviceBag:GetService(Ragdoll)
|
|
70
|
+
service:Start()
|
|
71
|
+
|
|
72
|
+
maid:GiveTask(function()
|
|
73
|
+
service:Destroy()
|
|
74
|
+
end)
|
|
75
|
+
|
|
76
|
+
local ragdollableBinder = serviceBag:GetService(Ragdollable)
|
|
77
|
+
local mockCounter = 0
|
|
78
|
+
|
|
79
|
+
local function addPlayer()
|
|
80
|
+
mockCounter += 1
|
|
81
|
+
|
|
82
|
+
local mock = playerMockService:CreatePlayer({ UserId = 66223300 + specCounter * 10 + mockCounter })
|
|
83
|
+
mock.Parent = container
|
|
84
|
+
maid:GiveTask(mock)
|
|
85
|
+
|
|
86
|
+
local character = RigBuilderUtils.createR6BaseRig()
|
|
87
|
+
PlayerMock.loadCharacterAsync(mock, character)
|
|
88
|
+
|
|
89
|
+
local humanoid = assert(character:FindFirstChildOfClass("Humanoid"), "No humanoid in rig")
|
|
90
|
+
|
|
91
|
+
-- Ragdolling only reaches the motors once Ragdollable has rigged the character, which mock
|
|
92
|
+
-- discovery does on its own a moment after the character loads.
|
|
93
|
+
local ok = ragdollableBinder:Promise(humanoid):Yield()
|
|
94
|
+
assert(ok, "Ragdollable never bound")
|
|
95
|
+
|
|
96
|
+
return {
|
|
97
|
+
mock = mock,
|
|
98
|
+
character = character,
|
|
99
|
+
humanoid = humanoid,
|
|
100
|
+
}
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
return {
|
|
104
|
+
serviceBag = serviceBag,
|
|
105
|
+
ragdollBinder = serviceBag:GetService(Ragdoll),
|
|
106
|
+
addPlayer = addPlayer,
|
|
107
|
+
run = function(commandName: string, ...)
|
|
108
|
+
return registered[commandName]({}, ...)
|
|
109
|
+
end,
|
|
110
|
+
destroy = function()
|
|
111
|
+
maid:DoCleaning()
|
|
112
|
+
end,
|
|
113
|
+
}
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
describe("RagdollCmdrService", function()
|
|
117
|
+
it("ragdolls and unragdolls a player, suppressing and restoring their motors", function()
|
|
118
|
+
local controller = setup()
|
|
119
|
+
local player = controller.addPlayer()
|
|
120
|
+
|
|
121
|
+
local output = controller.run("ragdoll", { player.mock })
|
|
122
|
+
expect(string.find(output, "Ragdolled", 1, true) ~= nil).toEqual(true)
|
|
123
|
+
expect(controller.ragdollBinder:Get(player.humanoid)).toBeDefined()
|
|
124
|
+
expect(RagdollTestUtils.waitFor(function()
|
|
125
|
+
return RagdollTestUtils.areMotorsEnabled(player.character, false)
|
|
126
|
+
end)).toBe(true)
|
|
127
|
+
|
|
128
|
+
output = controller.run("unragdoll", { player.mock })
|
|
129
|
+
expect(string.find(output, "Unragdolled", 1, true) ~= nil).toEqual(true)
|
|
130
|
+
expect(controller.ragdollBinder:Get(player.humanoid)).toBeNil()
|
|
131
|
+
expect(RagdollTestUtils.waitFor(function()
|
|
132
|
+
return RagdollTestUtils.areMotorsEnabled(player.character, true)
|
|
133
|
+
end)).toBe(true)
|
|
134
|
+
|
|
135
|
+
controller.destroy()
|
|
136
|
+
end)
|
|
137
|
+
|
|
138
|
+
it("acts on every player in the list", function()
|
|
139
|
+
local controller = setup()
|
|
140
|
+
local first = controller.addPlayer()
|
|
141
|
+
local second = controller.addPlayer()
|
|
142
|
+
|
|
143
|
+
controller.run("ragdoll", { first.mock, second.mock })
|
|
144
|
+
expect(controller.ragdollBinder:Get(first.humanoid)).toBeDefined()
|
|
145
|
+
expect(controller.ragdollBinder:Get(second.humanoid)).toBeDefined()
|
|
146
|
+
|
|
147
|
+
controller.run("unragdoll", { first.mock, second.mock })
|
|
148
|
+
expect(controller.ragdollBinder:Get(first.humanoid)).toBeNil()
|
|
149
|
+
expect(controller.ragdollBinder:Get(second.humanoid)).toBeNil()
|
|
150
|
+
|
|
151
|
+
controller.destroy()
|
|
152
|
+
end)
|
|
153
|
+
|
|
154
|
+
it("reports the players it could not act on without skipping the rest", function()
|
|
155
|
+
local controller = setup()
|
|
156
|
+
local ragdolled = controller.addPlayer()
|
|
157
|
+
local characterless = controller.addPlayer()
|
|
158
|
+
|
|
159
|
+
PlayerMock.removeCharacter(characterless.mock)
|
|
160
|
+
|
|
161
|
+
local output = controller.run("ragdoll", { characterless.mock, ragdolled.mock })
|
|
162
|
+
expect(string.find(output, "has no character", 1, true) ~= nil).toEqual(true)
|
|
163
|
+
expect(controller.ragdollBinder:Get(ragdolled.humanoid)).toBeDefined()
|
|
164
|
+
|
|
165
|
+
-- Already-ragdolled and not-ragdolled are reported rather than acted on twice.
|
|
166
|
+
expect(string.find(controller.run("ragdoll", { ragdolled.mock }), "already ragdolled", 1, true) ~= nil).toEqual(
|
|
167
|
+
true
|
|
168
|
+
)
|
|
169
|
+
expect(string.find(controller.run("unragdoll", { characterless.mock }), "has no character", 1, true) ~= nil).toEqual(
|
|
170
|
+
true
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
controller.run("unragdoll", { ragdolled.mock })
|
|
174
|
+
expect(string.find(controller.run("unragdoll", { ragdolled.mock }), "is not ragdolled", 1, true) ~= nil).toEqual(
|
|
175
|
+
true
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
controller.destroy()
|
|
179
|
+
end)
|
|
180
|
+
|
|
181
|
+
it("reports an empty player list", function()
|
|
182
|
+
local controller = setup()
|
|
183
|
+
|
|
184
|
+
expect(controller.run("ragdoll", {})).toEqual("No players to act on.")
|
|
185
|
+
expect(controller.run("unragdoll", {})).toEqual("No players to act on.")
|
|
186
|
+
|
|
187
|
+
controller.destroy()
|
|
188
|
+
end)
|
|
189
|
+
end)
|
|
@@ -23,9 +23,11 @@ function RagdollService:Init(serviceBag: ServiceBag.ServiceBag)
|
|
|
23
23
|
|
|
24
24
|
-- External
|
|
25
25
|
self._serviceBag:GetService(require("Motor6DService"))
|
|
26
|
+
self._serviceBag:GetService(require("CmdrService"))
|
|
26
27
|
|
|
27
28
|
-- Internal
|
|
28
29
|
self._serviceBag:GetService(require("RagdollBindersServer"))
|
|
30
|
+
self._serviceBag:GetService((require :: any)("RagdollCmdrService"))
|
|
29
31
|
|
|
30
32
|
-- Binders
|
|
31
33
|
self._serviceBag:GetService((require :: any)("Ragdoll"))
|
|
@@ -216,7 +216,7 @@ function RagdollBallSocketUtils.ensureBallSockets(character: Model, rigType: Enu
|
|
|
216
216
|
local observable = (RxR15Utils.observeRigMotorBrio(character, data.motorParentName, motorName) :: any):Pipe({
|
|
217
217
|
RxBrioUtils.switchMapBrio(function(motor)
|
|
218
218
|
if motor then
|
|
219
|
-
return RxBrioUtils.
|
|
219
|
+
return RxBrioUtils.flatCombineLatestBrio({
|
|
220
220
|
motor = Rx.of(motor),
|
|
221
221
|
part1 = RxR15Utils.observeCharacterPartBrio(character, part1Name),
|
|
222
222
|
attachment0 = RxR15Utils.observeRigAttachmentBrio(character, part0Name, attachmentName),
|
|
@@ -300,7 +300,7 @@ function RagdollMotorUtils.suppressJustRootPart(character: Model, rigType: Enum.
|
|
|
300
300
|
RxBrioUtils.switchMapBrio(function(motor): any
|
|
301
301
|
local ragdollMotorData = RagdollMotorData:Create(motor)
|
|
302
302
|
|
|
303
|
-
return
|
|
303
|
+
return RxBrioUtils.flatCombineLatestBrio({
|
|
304
304
|
motor = motor,
|
|
305
305
|
part0 = RxInstanceUtils.observeProperty(motor, "Part0"),
|
|
306
306
|
part1 = RxInstanceUtils.observeProperty(motor, "Part1"),
|
|
@@ -348,7 +348,7 @@ function RagdollMotorUtils.suppressMotors(
|
|
|
348
348
|
RxBrioUtils.switchMapBrio(function(motor): any
|
|
349
349
|
local ragdollMotorData = RagdollMotorData:Create(motor)
|
|
350
350
|
|
|
351
|
-
return RxBrioUtils.
|
|
351
|
+
return RxBrioUtils.flatCombineLatestBrio({
|
|
352
352
|
motor = motor,
|
|
353
353
|
part0 = RxInstanceUtils.observeProperty(motor, "Part0"),
|
|
354
354
|
part1 = RxInstanceUtils.observeProperty(motor, "Part1"),
|