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:
parent
c4188ca09d
commit
25abfb9476
@ -37,6 +37,7 @@ function HandleCarpetCommand( Split, Player )
|
|||||||
if( Carpet == nil ) then
|
if( Carpet == nil ) then
|
||||||
Carpets[ Player ] = cCarpet:new()
|
Carpets[ Player ] = cCarpet:new()
|
||||||
Player:SendMessage("You're on a magic carpet!" )
|
Player:SendMessage("You're on a magic carpet!" )
|
||||||
|
Player:SendMessage("Look straight down to descend. Jump to ascend!" )
|
||||||
else
|
else
|
||||||
Carpet:remove()
|
Carpet:remove()
|
||||||
Carpets[ Player ] = nil
|
Carpets[ Player ] = nil
|
||||||
@ -72,8 +73,7 @@ function OnPlayerMoving(Player)
|
|||||||
Carpet:moveTo( cLocation:new( Player:GetPosX(), Player:GetPosY() - 1, Player:GetPosZ() ) )
|
Carpet:moveTo( cLocation:new( Player:GetPosX(), Player:GetPosY() - 1, Player:GetPosZ() ) )
|
||||||
else
|
else
|
||||||
if( Player:GetPosY() < Carpet:getY() ) then
|
if( Player:GetPosY() < Carpet:getY() ) then
|
||||||
LOGINFO("Fell tru mc!")
|
Player:TeleportToCoords(Player:GetPosX(), Carpet:getY(), Player:GetPosZ())
|
||||||
Player:TeleportTo( Player:GetPosX(), Carpet:getY(), Player:GetPosZ() )
|
|
||||||
end
|
end
|
||||||
Carpet:moveTo( cLocation:new( Player:GetPosX(), Player:GetPosY(), Player:GetPosZ() ) )
|
Carpet:moveTo( cLocation:new( Player:GetPosX(), Player:GetPosY(), Player:GetPosZ() ) )
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user