mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-22 14:56:17 +00:00
Anti-lag script
This didn't get fully committed last time for some reason?
This commit is contained in:
parent
a0933df9c3
commit
8a99e0716f
1 changed files with 6 additions and 0 deletions
|
|
@ -244,10 +244,16 @@ class Spriteset_Map
|
||||||
@character_sprites.each do |sprite|
|
@character_sprites.each do |sprite|
|
||||||
if !sprite.character.is_a?(Game_Event)
|
if !sprite.character.is_a?(Game_Event)
|
||||||
sprite.update
|
sprite.update
|
||||||
|
elsif
|
||||||
|
|
||||||
# this is just a check to make sure the sprite is onscreen for game events
|
# this is just a check to make sure the sprite is onscreen for game events
|
||||||
# based on its current width and height
|
# based on its current width and height
|
||||||
# no point in updating the sprite if offscreen
|
# no point in updating the sprite if offscreen
|
||||||
# this greatly increases performance on larger maps
|
# this greatly increases performance on larger maps
|
||||||
|
|
||||||
|
((sprite.character.real_x + (sprite.ox*4) > $game_map.display_x - 128) &&
|
||||||
|
(sprite.character.real_x - (sprite.ox*4) < $game_map.display_x + (21 * 128)) &&
|
||||||
|
(sprite.character.real_y + (sprite.oy*4) > ($game_map.display_y) - 128) &&
|
||||||
(sprite.character.real_y - (sprite.oy*4) < ($game_map.display_y) + (17 * 128)))
|
(sprite.character.real_y - (sprite.oy*4) < ($game_map.display_y) + (17 * 128)))
|
||||||
sprite.update
|
sprite.update
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue