Skip to content

Commit

Permalink
Merge pull request #38 from Freelander/release-1.10
Browse files Browse the repository at this point in the history
[MOHW] add beta support for game Medal of Honor: Warfighter
  • Loading branch information
thomasleveil committed Feb 27, 2013
2 parents df64331 + 838a9c3 commit aa4a480
Show file tree
Hide file tree
Showing 5 changed files with 1,061 additions and 8 deletions.
7 changes: 7 additions & 0 deletions b3/parsers/bf3.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,13 @@ class Bf3Parser(AbstractParser):
'gunMasterWeaponsPreset'
)

# gamemodes aliases {alias: actual game mode name}
_gamemode_aliases = {
'cq': 'conquest',
'cq64': 'conquest64',
'tdm': 'team deathmatch',
'sqdm': 'squad deathmatch',
}

def startup(self):
AbstractParser.startup(self)
Expand Down
9 changes: 2 additions & 7 deletions b3/parsers/frostbite2/abstractParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1550,13 +1550,8 @@ def getGamemodeSoundingLike(self, map_id, gamemode_name):

supported_gamemode_names = map(self.getGameMode, supported_gamemode_ids)

shortnames = {
'cq': 'conquest',
'cq64': 'conquest64',
'tdm': 'team deathmatch',
'sqdm': 'squad deathmatch',
}
clean_gamemode_name = shortnames.get(clean_gamemode_name, clean_gamemode_name)
aliases = getattr(self, '_gamemode_aliases', {})
clean_gamemode_name = aliases.get(clean_gamemode_name, clean_gamemode_name)

matches = getStuffSoundingLike(clean_gamemode_name, supported_gamemode_names)
if len(matches) == 1:
Expand Down
2 changes: 1 addition & 1 deletion b3/parsers/frostbite2/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def __getitem__(self, key):
return self._map_data[key]

def __repr__(self):
txt = "MapListBlock["
txt = self.__class__.__name__ + "["
map_info_repr = []
for p in self:
map_info_repr.append("%(name)s:%(gamemode)s:%(num_of_rounds)s" % p)
Expand Down
Loading

0 comments on commit aa4a480

Please sign in to comment.