PumpCharacterUpdate() works from lua to client, read more

There was a bug in the entity API, where getMotion() was pushing the
origin instead of the motion. This has been corrected. Since this is an
important bug, and because the features for this leg is finished, I'll
merge this to master.
This commit is contained in:
Kayne Ruse
2015-02-27 02:39:27 +11:00
parent 067bf40be7
commit 4630b7e403
7 changed files with 79 additions and 7 deletions
+10 -2
View File
@@ -4,6 +4,7 @@ mapMaker = require("map_maker")
mapSaver = require("map_saver")
roomSystem = require("room_system")
characterSystem = require("character_system")
networkSystem = require("network")
local function dumpTable(t)
print(t)
@@ -18,12 +19,19 @@ roomSystem.RoomManager.SetOnCreate(function(room, index)
--called ~60 times per second
roomSystem.Room.SetOnTick(room, function(room)
--[[
local character = characterSystem.CharacterManager.GetCharacter("handle")
if character ~= nil then
--debugging
local x, y = characterSystem.Character.GetOrigin(character)
print("character.Origin(x, y): ", x, y)
local originX, originY = characterSystem.Character.GetOrigin(character)
local motionX, motionY = characterSystem.Character.GetMotion(character)
if motionY < 0 then
characterSystem.Character.SetMotion(character, motionX, 0)
networkSystem.PumpCharacterUpdate(character)
print("Sending: ", motionX, motionY)
end
end
--]]
end)
end)