1
0

Updated MagicCarpet to use new API [SEE DESC]

Fixed non-teleportation upon falling through carpet due to use of
deprecated function.
Fixed spam of console upon falling through carpet.
Added descriptive upon-enable message.
This commit is contained in:
Tiger Wang 2013-07-30 22:26:50 +01:00
parent c4188ca09d
commit 25abfb9476

View File

@ -37,6 +37,7 @@ function HandleCarpetCommand( Split, Player )
if( Carpet == nil ) then
Carpets[ Player ] = cCarpet:new()
Player:SendMessage("You're on a magic carpet!" )
Player:SendMessage("Look straight down to descend. Jump to ascend!" )
else
Carpet:remove()
Carpets[ Player ] = nil
@ -72,8 +73,7 @@ function OnPlayerMoving(Player)
Carpet:moveTo( cLocation:new( Player:GetPosX(), Player:GetPosY() - 1, Player:GetPosZ() ) )
else
if( Player:GetPosY() < Carpet:getY() ) then
LOGINFO("Fell tru mc!")
Player:TeleportTo( Player:GetPosX(), Carpet:getY(), Player:GetPosZ() )
Player:TeleportToCoords(Player:GetPosX(), Carpet:getY(), Player:GetPosZ())
end
Carpet:moveTo( cLocation:new( Player:GetPosX(), Player:GetPosY(), Player:GetPosZ() ) )
end