赞 | 20 |
VIP | 0 |
好人卡 | 0 |
积分 | 46 |
经验 | 9447 |
最后登录 | 2024-5-20 |
在线时间 | 383 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 4551
- 在线时间
- 383 小时
- 注册时间
- 2012-11-8
- 帖子
- 275
|
问题在于下一次循环的update_help,由于没调整@window_mercenaries.index,这时候是越界的。- def update_help
- if @window_mercenaries.active
- @window_help.visible=true
- cw=@window_mercenaries.index%@window_mercenaries.column_max*64
- ch=@window_mercenaries.index/@window_mercenaries.column_max*80
- @window_help.x=cw+@window_mercenaries.x+64
- @window_help.y=ch+@window_mercenaries.y+80
- if @window_help.x+@window_help.width>640
- @window_help.x=640-@window_help.width
- end
- if @window_help.y+@window_help.height>480
- @window_help.y=480-@window_help.height
- end
- @window_help.draw_actor($game_actors[@window_mercenaries.id])#@window_mercenaries.id返回的是@mercenaries[self.index],越界,返回nil,$game_actors[nil]当然会出错
- else
- @window_help.visible=false
- end
- end
复制代码
|
|