载具销毁请求处理

This commit is contained in:
UnKownOwO
2022-12-19 17:39:12 +08:00
parent 52abb71975
commit a18222f363
2 changed files with 21 additions and 6 deletions
+11
View File
@@ -11,6 +11,17 @@ import (
pb "google.golang.org/protobuf/proto"
)
// VehicleDestroyMotion 载具销毁动作
func (g *GameManager) VehicleDestroyMotion(player *model.Player, entity *Entity, state proto.MotionState) {
world := WORLD_MANAGER.GetWorldByID(player.WorldId)
scene := world.GetSceneById(player.SceneId)
// 状态等于 MOTION_STATE_DESTROY_VEHICLE 代表请求销毁
if state == proto.MotionState_MOTION_STATE_DESTROY_VEHICLE {
g.DestroyVehicleEntity(player, scene, entity.gadgetEntity.gadgetVehicleEntity.vehicleId, entity.id)
}
}
// CreateVehicleReq 创建载具
func (g *GameManager) CreateVehicleReq(player *model.Player, payloadMsg pb.Message) {
req := payloadMsg.(*proto.CreateVehicleReq)