1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
|
diff -rU9 clone-990617/src/action/action_board.c clone-990617-jjc/src/action/action_board.c
--- clone-990617/src/action/action_board.c Wed Jun 16 16:04:21 1999
+++ clone-990617-jjc/src/action/action_board.c Sat Aug 14 14:08:55 1999
@@ -145,19 +145,19 @@
switch( unit->SubAction ) {
//
// Wait for transporter
//
case 101:
// FIXME: show still animations
DebugLevel3("Waiting\n");
if( WaitForTransporter(unit) ) {
- unit->SubAction=2;
+ unit->SubAction=102;
}
break;
//
// Enter transporter
//
case 102:
EnterTransporter(unit);
break;
//
@@ -168,17 +168,17 @@
if( /*unit->SubAction >= 0 &&*/ unit->SubAction <= 100 )
// ^^^^^^always true
if( (i=MoveToTransporter(unit)) ) {
if( i==-1 ) {
if( ++unit->SubAction==100 ) {
unit->Command.Action=UnitActionStill;
unit->SubAction=0;
}
} else {
- unit->SubAction=1;
+ unit->SubAction=101;
}
}
break;
}
}
//@}
diff -rU9 clone-990617/src/action/action_hauloil.c clone-990617-jjc/src/action/action_hauloil.c
--- clone-990617/src/action/action_hauloil.c Wed Jun 16 16:04:21 1999
+++ clone-990617-jjc/src/action/action_hauloil.c Sat Aug 14 13:06:23 1999
@@ -41,18 +41,23 @@
if( !(i=HandleActionMove(unit)) ) { // reached end-point
return 0;
}
DebugLevel3("Result: %d\n",i);
if( i==-1 ) {
DebugLevel2("OIL-WELL NOT REACHED\n");
return -1;
}
+ if( !(unit->Command.Data.Move.Goal)){
+ DebugLevel2("Invalid Oil Well\n");
+ return -1;
+ }
+
well=unit->Command.Data.Move.Goal;
unit->Command.Action=UnitActionHaulOil;
DebugCheck( !well || MapDistanceToUnit(unit->X,unit->Y,well)!=1 );
//
// Activate oil-well
//
if( !well->Type->GivesOil ) {
diff -rU9 clone-990617/src/include/clone.h clone-990617-jjc/src/include/clone.h
--- clone-990617/src/include/clone.h Wed Jun 16 16:04:18 1999
+++ clone-990617-jjc/src/include/clone.h Sat Aug 14 13:09:22 1999
@@ -68,19 +68,19 @@
/**
** Include code only if debugging.
*/
#define IfDebug(code) code
/**
** Debug check condition
*/
-#define DebugCheck(cond) do{ if( cond ) { abort(); } }while( 0 )
+#define DebugCheck(cond) do{ if( cond ) { printf("DebugCheck at %s:%d\n",__FILE__,__LINE__); abort(); } }while( 0 )
/**
** Print debug information of level 0.
*/
#define DebugLevel0(fmt...) printf(fmt##)
/**
** Print debug information of level 1.
*/
diff -rU9 clone-990617/src/sound/sound_server.c clone-990617-jjc/src/sound/sound_server.c
--- clone-990617/src/sound/sound_server.c Wed Jun 16 16:04:22 1999
+++ clone-990617-jjc/src/sound/sound_server.c Sat Jul 24 18:19:14 1999
@@ -236,19 +236,21 @@
*/
local int MixSampleToStereo32(Sample* sample,int index,unsigned char volume,
int* buffer,int size)
{
int ri;
int wi;
int length;
int v;
int local_volume;
-
+
+ if(!sample)
+ return 0;
local_volume=((int)volume+1)*2*GlobalVolume/MaxVolume;
length=sample->Length-index;
DebugLevel3("Length %d\n",length);
// FIXME: support other formats, stereo or 32 bit ...
if( sample->SampleSize==8 ) {
unsigned char* rp;
@@ -616,20 +618,23 @@
int new_free_channels;
new_free_channels=0;
for( channel=0; channel<MaxChannels; ++channel ) {
if( Channels[channel].Command==ChannelPlay ) {
i=MixSampleToStereo32(
Channels[channel].Sample,Channels[channel].Point,
Channels[channel].Volume,buffer,size);
Channels[channel].Point+=i;
-
- if( Channels[channel].Point>=Channels[channel].Sample->Length ) {
+
+ if( !Channels[channel].Sample){
+ new_free_channels++;
+ FreeOneChannel(channel);
+ } else if( Channels[channel].Point>=Channels[channel].Sample->Length ) {
// free channel as soon as possible (before playing)
// useful in multithreading
DebugLevel3("End playing request from %p\n",
Channels[channel].Source.Base);
FreeOneChannel(channel);
new_free_channels++;
}
}
}
diff -rU9 clone-990617/src/ui/botpanel.c clone-990617-jjc/src/ui/botpanel.c
--- clone-990617/src/ui/botpanel.c Wed Jun 16 16:04:21 1999
+++ clone-990617-jjc/src/ui/botpanel.c Fri Aug 6 19:26:55 1999
@@ -2254,27 +2254,39 @@
}
break;
case UnitFoundryHuman:
if( player==ThisPlayer ) {
ShipyardHumanButtons[3].Icon=IconBattleship;
ShipyardHumanButtons[3].Action=B_Train;
ShipyardHumanButtons[3].Value=UnitBattleship;
ShipyardHumanButtons[3].Key='b';
ShipyardHumanButtons[3].Text="BUILD ~BATTLESHIP";
+ ShipyardHumanButtons[2].Icon=IconTransportHuman;
+ ShipyardHumanButtons[2].Action=B_Train;
+ ShipyardHumanButtons[2].Value=UnitTransportHuman;
+ ShipyardHumanButtons[2].Key='t';
+ ShipyardHumanButtons[2].Text="BUILD ~TRANSPORT";
+
}
break;
case UnitFoundryOrc:
if( player==ThisPlayer ) {
ShipyardOrcButtons[3].Icon=IconJuggernaught;
ShipyardOrcButtons[3].Action=B_Train;
ShipyardOrcButtons[3].Value=UnitJuggernaught;
ShipyardOrcButtons[3].Key='j';
ShipyardOrcButtons[3].Text="BUILD ~JUGGERNAUGHT";
+ ShipyardHumanButtons[2].Icon=IconTransportOrc;
+ ShipyardHumanButtons[2].Action=B_Train;
+ ShipyardHumanButtons[2].Value=UnitTransportOrc;
+ ShipyardHumanButtons[2].Key='t';
+ ShipyardHumanButtons[2].Text="BUILD ~TRANSPORT";
+
}
break;
#if 0
case UnitMageTower:
case UnitTempleOfTheDamned:
#endif
case UnitBlacksmithHuman:
if( player==ThisPlayer ) {
// Enable ballista!
|