-- author: rafftnix
-- date: 14.08.2015

-- fix for players holding net and foil roles in MP

local oldPlayerDelete = Player.delete; 
Player.delete = function(self)
	if self.isServer and self.currentRoleMount ~= nil then
		self.currentRoleMount:playerRemoveRole(self, true);
		for a=1, table.getn(self.currentRoleMount.roles) do
			if not self.currentRoleMount.roles[a].visibility then
				self.currentRoleMount:setRoleVisibility(a, true);
				break;
			end;
		end;
	end;
	oldPlayerDelete(self);
end;