Skip to content

Commit

Permalink
adv plugin: prevent error if next map is not returned
Browse files Browse the repository at this point in the history
  • Loading branch information
ozguruysal committed Jul 17, 2011
1 parent 1ae5b41 commit 081f669
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions b3/plugins/adv.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# CHANGELOG
# 07/17/2011 - 1.3.2 - Freelander
# prevent error if next map is not returned
# 04/18/2011 - 1.3.1 - Courgette
# makes @admins show admins' level as well
# 04/18/2011 - 1.3.0 - Courgette
Expand All @@ -42,7 +44,7 @@
# Converted to use XML config

__author__ = 'ThorN'
__version__ = '1.3.1'
__version__ = '1.3.2'

import b3
import os
Expand Down Expand Up @@ -224,7 +226,11 @@ def adv(self, firstTry=True):
ad = self._msg.getnext()
if ad:
if ad == "@nextmap":
ad = "^2Next map: ^3" + self.console.getNextMap()
if self.console.getNextMap():
ad = "^2Next map: ^3" + self.console.getNextMap()
else:
self.debug('Cannot get map rotation')
ad = None
elif ad == "@time":
ad = "^2Time: ^3" + self.console.formatTime(time.time())
elif ad[:5] == "@feed" and self._feed:
Expand Down

0 comments on commit 081f669

Please sign in to comment.