咖啡豆bug修复说明
This commit is contained in:
parent
8656af0d59
commit
4a527d1946
@ -1181,12 +1181,10 @@ class CoffeeBean(Plant):
|
||||
def idling(self):
|
||||
if (self.frame_index + 1) == self.frame_num:
|
||||
self.mapContent[c.MAP_SLEEP] = False
|
||||
# 注意:这里有bug —— 未判断本行的睡眠蘑菇是否在这一格
|
||||
for plant in self.plant_group:
|
||||
if plant.can_sleep:
|
||||
if plant.state == c.SLEEP:
|
||||
plantMapX, _ = self.map.getMapIndex(plant.rect.centerx, plant.rect.bottom)
|
||||
print(plantMapX, self.map_x)
|
||||
if plantMapX == self.map_x:
|
||||
plant.state = c.IDLE
|
||||
plant.setIdle()
|
||||
|
||||
@ -491,6 +491,8 @@ class Level(tool.State):
|
||||
for i in self.plant_groups[map_y]:
|
||||
if (x >= i.rect.x and x <= i.rect.right and
|
||||
y >= i.rect.y and y <= i.rect.bottom):
|
||||
if i.name in {c.HOLE, c.ICE_FROZEN_PLOT}:
|
||||
continue
|
||||
# 优先移除花盆、睡莲上的植物而非花盆、睡莲本身
|
||||
if len(self.map.map[map_y][map_x][c.MAP_PLANT]) >= 2:
|
||||
if c.LILYPAD in self.map.map[map_y][map_x][c.MAP_PLANT]:
|
||||
@ -1233,6 +1235,8 @@ class Level(tool.State):
|
||||
for i in self.plant_groups[map_y]:
|
||||
if (x >= i.rect.x and x <= i.rect.right and
|
||||
y >= i.rect.y and y <= i.rect.bottom):
|
||||
if i.name in {c.HOLE, c.ICE_FROZEN_PLOT}:
|
||||
continue
|
||||
# 优先选中睡莲、花盆上的植物
|
||||
if len(self.map.map[map_y][map_x][c.MAP_PLANT]) >= 2:
|
||||
if c.LILYPAD in self.map.map[map_y][map_x][c.MAP_PLANT]:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user