mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-02-06 23:59:18 +08:00
select random index instead of spawn positions shuffle
This commit is contained in:
parent
df31e4319b
commit
52369fec47
@ -251,9 +251,6 @@ class Map(Actor):
|
|||||||
or [(0, 0, 0, 0, 0, 0)])
|
or [(0, 0, 0, 0, 0, 0)])
|
||||||
self.ffa_spawn_points = (self.get_def_points('ffa_spawn')
|
self.ffa_spawn_points = (self.get_def_points('ffa_spawn')
|
||||||
or [(0, 0, 0, 0, 0, 0)])
|
or [(0, 0, 0, 0, 0, 0)])
|
||||||
# Let's shuffle our spawn points,
|
|
||||||
# so that no one is offended by the constant spawn on the edge.
|
|
||||||
random.shuffle(self.ffa_spawn_points)
|
|
||||||
self.spawn_by_flag_points = (self.get_def_points('spawn_by_flag')
|
self.spawn_by_flag_points = (self.get_def_points('spawn_by_flag')
|
||||||
or [(0, 0, 0, 0, 0, 0)])
|
or [(0, 0, 0, 0, 0, 0)])
|
||||||
self.flag_points = self.get_def_points('flag') or [(0, 0, 0)]
|
self.flag_points = self.get_def_points('flag') or [(0, 0, 0)]
|
||||||
@ -279,7 +276,10 @@ class Map(Actor):
|
|||||||
self.is_flying = False
|
self.is_flying = False
|
||||||
|
|
||||||
# FIXME: this should be part of game; not map.
|
# FIXME: this should be part of game; not map.
|
||||||
self._next_ffa_start_index = 0
|
# Let's select random index for first spawn point,
|
||||||
|
# so that no one is offended by the constant spawn on the edge.
|
||||||
|
self._next_ffa_start_index = random.randrange(
|
||||||
|
len(self.ffa_spawn_points))
|
||||||
|
|
||||||
def is_point_near_edge(self,
|
def is_point_near_edge(self,
|
||||||
point: ba.Vec3,
|
point: ba.Vec3,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user