X-Git-Url: https://git.yukkurigames.com/?p=python-bulletml.git;a=blobdiff_plain;f=bulletml%2Fparser.py;h=1470ed37bee5959dd2496a5ffc0fe52351f686df;hp=150ca4544ef53d6a43f177c7957ef709c1ccf537;hb=4c11ea4b779470d67cad2f6a060a51424625cff9;hpb=9da06c24edb2148cf6b773b58d280a1db407c5ce diff --git a/bulletml/parser.py b/bulletml/parser.py index 150ca45..1470ed3 100644 --- a/bulletml/parser.py +++ b/bulletml/parser.py @@ -816,15 +816,15 @@ class FireDef(object): def __call__(self, owner, action, params, rank, created): direction, speed, tags, appearance, actions = self.bullet( owner, action, params, rank, created) - if self.direction: + if self.direction is not None: direction = self.direction(params, rank) - if self.speed: + if self.speed is not None: speed = self.speed(params, rank) tags = tags.union(self.tags) - if self.appearance: + if self.appearance is not None: appearance = self.appearance - if direction: + if direction is not None: direction, type = direction if type == "aim" or type is None: direction += owner.aim @@ -836,7 +836,7 @@ class FireDef(object): direction = owner.aim action.previous_fire_direction = direction - if speed: + if speed is not None: speed, type = speed if type == "sequence": speed += action.previous_fire_speed @@ -851,8 +851,9 @@ class FireDef(object): speed = 1 action.previous_fire_speed = speed - x, y = owner.x, owner.y - if self.offset: + x = owner.x + y = owner.y + if self.offset is not None: off_x, off_y = self.offset(params, rank) if self.offset.type == "relative": s = sin(direction)