Skip to content

Commit

Permalink
Code drop
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmcwatters committed May 12, 2016
1 parent 0e4ae2b commit 8da02e4
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/engine/client/camera.lua
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ function getZoom()
end

function resetZoom()
setZoom( 2 )
end

function screenToWorld( x, y )
Expand Down
6 changes: 6 additions & 0 deletions src/engine/client/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ function disconnect()
-- Retrieve subsystems
local entities = _G.entities
local game = _G.game
local region = _G.region
local engine = _G.engine

-- Shutdown entities
Expand All @@ -111,6 +112,11 @@ function disconnect()
end
end

-- Unload all regions
if ( region ) then
region.unloadAll()
end

-- Shutdown server engine interface
if ( engine ) then
if ( engine.server ) then
Expand Down
6 changes: 2 additions & 4 deletions src/engine/shared/baselib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,13 @@ function type( object )
return rawtype( object )
end

local base = nil

function typeof( object, class )
if ( type( object ) == class ) then
return true
end

if ( rawtype( object ) == "table" and object.__base ) then
base = getbaseclass( object )
if ( rawtype( object ) == "table" ) then
local base = getbaseclass( object )
while ( base ~= nil ) do
if ( base.__type == class ) then
return true
Expand Down
1 change: 1 addition & 0 deletions src/engine/shared/entities/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ function shutdown()
_G.entity.lastEntIndex = 0

if ( _G.player ) then
_G.player.removeAll()
_G.player.lastPlayerId = 0
end

Expand Down
4 changes: 4 additions & 0 deletions src/engine/shared/entities/player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ function player.getInOrNearRegion( region )
return #t > 0 and t or nil
end

function player.removeAll()
table.clear( player.players )
end

function player:player()
character.character( self )

Expand Down

0 comments on commit 8da02e4

Please sign in to comment.