Bad Boy JH
2010-11-24 01:43:19
I hit the pinball random, and when I found Reflections solver didn't work, I have fixing it a shot, and here it is. I just ran it, got me out of the random beautifully.
There are only minor fixes to R_SolvePinball, it would detect the new pinball post before it had changed, causing it tag the same post twice, this has now been fixed. The only other change is to comment out those four lines at the end, which are commented out of almost all randoms that I checked. This random should now work A-OK.
Just call me the exterminator, cause I get rid of bugs.. :D
There are only minor fixes to R_SolvePinball, it would detect the new pinball post before it had changed, causing it tag the same post twice, this has now been fixed. The only other change is to comment out those four lines at the end, which are commented out of almost all randoms that I checked. This random should now work A-OK.
Just call me the exterminator, cause I get rid of bugs.. :D
function R_SolvePinball : Boolean;
var
LastPole, CurrPole: TRSObject;
P: TPoint;
t, lastscore, currscore: integer;
begin
if not R_InPinball then Exit;
while R_InPinball do
begin
lastscore := Pinball_GetScore;
currscore := Pinball_GetScore;
if(currscore >= 10)then
begin
Writeln('Done tagging pillars! Score is 10!');
Result := True;
Pinball_Leave;
Break;
end;
while R_ClickToContinue do
wait(900+Random(900));
LastPole := CurrPole;
MarkTime(t);
while ((LastPole = CurrPole) and (TimeFromMark(t) < 10000)) do
CurrPole := Pinball_GetPillar;
if (CurrPole <> NULL_RSOBJECT)then
begin
P := TileToMS(CurrPole.Tile, 400);
Mouse(P.x, P.y, 3, 3, false);
if R_ChooseOption('tag')then
begin
Writeln('Tagged!');
MarkTime(t);
while((currscore = lastscore) and (TimeFromMark(t) < 10000)) do
begin
if CharacterMoving then
MarkTime(t);
currscore := Pinball_GetScore;
end;
end;
end;
end;
R_ClickToContinue;
Result := not R_InPinball;
{ if Result then
Inc(RSolved[RPinballs])
else
Inc(RFailed[RPinballs]); }
end;