Exemplo n.º 1
0
        void HandleSetEntityProperty()
        {
            byte id    = reader.ReadUInt8();
            byte type  = reader.ReadUInt8();
            int  value = reader.ReadInt32();

            Entity entity = game.Entities[id];

            if (entity == null)
            {
                return;
            }
            LocationUpdate update = LocationUpdate.Empty();

            switch (type)
            {
            case 0:
                update.RotX = LocationUpdate.Clamp(value); break;

            case 1:
                update.RotY = LocationUpdate.Clamp(value); break;

            case 2:
                update.RotZ = LocationUpdate.Clamp(value); break;

            default:
                return;
            }
            entity.SetLocation(update, true);
        }
Exemplo n.º 2
0
		void HandleSetEntityProperty() {
			byte id = reader.ReadUInt8();
			byte type = reader.ReadUInt8();
			int value = reader.ReadInt32();
			
			Entity entity = game.Entities.List[id];
			if (entity == null) return;
			LocationUpdate update = LocationUpdate.Empty();
			
			switch (type) {
				case 0:
					update.RotX = LocationUpdate.Clamp(value); break;
				case 1:
					update.RotY = LocationUpdate.Clamp(value); break;
				case 2:
					update.RotZ = LocationUpdate.Clamp(value); break;
					
				case 3:
				case 4:
				case 5:
					float scale = value / 1000.0f;
					Utils.Clamp(ref scale, 0.01f, entity.Model.MaxScale);
					if (type == 3) entity.ModelScale.X = scale;
					if (type == 4) entity.ModelScale.Y = scale;
					if (type == 5) entity.ModelScale.Z = scale;
					
					entity.UpdateModelBounds();
					return;
				default:
					return;
			}
			entity.SetLocation(update, true);
		}
Exemplo n.º 3
0
        void HandleSetEntityProperty()
        {
            byte id    = reader.ReadUInt8();
            byte type  = reader.ReadUInt8();
            int  value = reader.ReadInt32();

            Entity entity = game.Entities[id];

            if (entity == null)
            {
                return;
            }
            LocationUpdate update = LocationUpdate.Empty();

            switch (type)
            {
            case 0:
                update.RotX = LocationUpdate.Clamp(value); break;

            case 1:
                update.RotY = LocationUpdate.Clamp(value); break;

            case 2:
                update.RotZ = LocationUpdate.Clamp(value); break;

            case 3:
                getdamage(value); break;

            case 4:
                pposx = value; break;

            case 5:
                pposz = value; game.LocalPlayer.Velocity = CalculVelocityPlayer(game.LocalPlayer.Position); break;

            default:
                return;
            }


            entity.SetLocation(update, true);
        }