Browse Source

Fix `player_api.set_model` not updating the animation

Lars Mueller 1 year ago
parent
commit
8d60e85dfc
1 changed files with 4 additions and 0 deletions
  1. 4 0
      mods/player_api/api.lua

+ 4 - 0
mods/player_api/api.lua

@@ -67,7 +67,11 @@ function player_api.set_model(player, model_name)
 	if player_data.model == model_name then
 		return
 	end
+	-- Update data
 	player_data.model = model_name
+	-- Clear animation data as the model has changed
+	-- (required for setting the `stand` animation not to be a no-op)
+	player_data.animation, player_data.animation_speed = nil, nil
 
 	local model = models[model_name]
 	if model then