openbsd-ports/games/capitan-sevilla/patches/patch-src_background_cpp
stsp fa26d661f8 Captain Sevilla is a platform game with hero Mariano Lopez, a sausage
delivery man who is transformed into Captain 'S' after eating
radioactive sausages.  The game's villain is Dr. Torrebruno, an eminent
nuclear physicist with a strange mental disease. The game can be played
in Spanish and in English.

ok rpointel benoit
2011-06-05 11:13:47 +00:00

21 lines
830 B
Plaintext

$OpenBSD: patch-src_background_cpp,v 1.1.1.1 2011/06/05 11:13:47 stsp Exp $
This fixes a random crash that happened during the second screen in the game.
--- src/background.cpp.orig Fri Apr 10 12:57:23 2009
+++ src/background.cpp Sat Jun 4 23:31:33 2011
@@ -184,7 +184,12 @@ void Background::MueveOvni ()
int Velocidad;
for (int n = 0; n < MaxOvnis; n++) {
Ovni[n].IncX ((int) Ovni[n].VerVelX());
- Ovni[n].SetY ((int) (OrigOvni[n] + (3 + n) * FuncionSeno[Ovni[n].VerX()]));
+ int x = Ovni[n].VerX();
+ if (x < 0)
+ x = 0;
+ else if (x >= FramesCirculo)
+ x = FramesCirculo - 1;
+ Ovni[n].SetY ((int) (OrigOvni[n] + (3 + n) * FuncionSeno[x]));
if ((Ovni[n].VerX(true) < 0 || Ovni[n].VerX(false) > 640) && !((int)(rand() % 60))) {
if ((int)rand() % 2)