View Single Post
Old 08-09-07, 02:12 PM   #56
minsc_tdp
XO
 
Join Date: Mar 2007
Posts: 411
Downloads: 1
Uploads: 0
Default minor tube bug

Noticed a minor tube bug very late last night, I was too tired to fix it. I'm going to update the zip with this, but here it is for now in case this is bothering anyone:

Problem: If you're on tube 3 (which sh4speech knows) and you load a game or otherwise reset things, you'll be on tube 1. When you use the tube reset command "set all tubes closed" it still thinks you're on tube 3 and when you use any tube command it will use the wrong tube every time from that point forward.

Solution:
Set the internal "current_tube" variable to 1 when "set all tubes closed" command is issued.

Code patch (insert as line 160. should be inside the ALLCLOSE if block)
$VARS{"current_tube"} = 1;

So that general area should look like:

Code:
 
if ($data eq "ALLCLOSE") {
   for my $tube (1..$tubes) {
      print "\t\tSetting tube $tube status to CLOSE\n";
      $VARS{"tube".$tube."status"} = "CLOSE";
   }
$VARS{"current_tube"} = 1; # If tubes are reset/allclosed, game was probably saveloaded or restarted and we're back on tube 1
} else {
__________________
June 29 2016 - shSpeech v2.55 - Voice Command for Silent Hunter 4! View Thread
minsc_tdp is offline   Reply With Quote