equal
deleted
inserted
replaced
222 slot, ami: LongInt; |
222 slot, ami: LongInt; |
223 hhammo: PHHAmmo; |
223 hhammo: PHHAmmo; |
224 CurWeapon: PAmmo; |
224 CurWeapon: PAmmo; |
225 a: TAmmoType; |
225 a: TAmmoType; |
226 begin |
226 begin |
|
227 if ammo = amNothing then exit; |
227 {$HINTS OFF} |
228 {$HINTS OFF} |
228 FillChar(ammos, sizeof(ammos), 0); |
229 FillChar(ammos, sizeof(ammos), 0); |
229 {$HINTS ON} |
230 {$HINTS ON} |
230 hhammo:= Hedgehog.Ammo; |
231 hhammo:= Hedgehog.Ammo; |
231 |
232 |
319 procedure ApplyAngleBounds(var Hedgehog: THedgehog; AmmoType: TAmmoType); |
320 procedure ApplyAngleBounds(var Hedgehog: THedgehog; AmmoType: TAmmoType); |
320 begin |
321 begin |
321 if Hedgehog.Gear <> nil then |
322 if Hedgehog.Gear <> nil then |
322 with Hedgehog do |
323 with Hedgehog do |
323 begin |
324 begin |
324 CurMinAngle:= Ammoz[AmmoType].minAngle; |
325 if (AmmoType <> amNothing) then |
325 if Ammoz[AmmoType].maxAngle <> 0 then |
326 begin |
326 CurMaxAngle:= Ammoz[AmmoType].maxAngle |
327 CurMinAngle:= Ammoz[AmmoType].minAngle; |
327 else |
328 if Ammoz[AmmoType].maxAngle <> 0 then |
328 CurMaxAngle:= cMaxAngle; |
329 CurMaxAngle:= Ammoz[AmmoType].maxAngle |
329 |
330 else |
330 with Hedgehog.Gear^ do |
331 CurMaxAngle:= cMaxAngle; |
331 begin |
332 |
332 if Angle < CurMinAngle then |
333 with Hedgehog.Gear^ do |
333 Angle:= CurMinAngle; |
334 begin |
334 if Angle > CurMaxAngle then |
335 if Angle < CurMinAngle then |
335 Angle:= CurMaxAngle; |
336 Angle:= CurMinAngle; |
|
337 if Angle > CurMaxAngle then |
|
338 Angle:= CurMaxAngle; |
|
339 end |
336 end |
340 end |
337 end |
341 end |
338 end; |
342 end; |
339 |
343 |
340 procedure SwitchToFirstLegalAmmo(var Hedgehog: THedgehog); |
344 procedure SwitchToFirstLegalAmmo(var Hedgehog: THedgehog); |
506 RegisterVariable('ammdelay', @SetAmmoDelay, false); |
510 RegisterVariable('ammdelay', @SetAmmoDelay, false); |
507 RegisterVariable('ammprob', @SetAmmoProbability, false); |
511 RegisterVariable('ammprob', @SetAmmoProbability, false); |
508 RegisterVariable('ammreinf', @SetAmmoReinforcement, false); |
512 RegisterVariable('ammreinf', @SetAmmoReinforcement, false); |
509 RegisterVariable('ammstore', @chAddAmmoStore , false); |
513 RegisterVariable('ammstore', @chAddAmmoStore , false); |
510 |
514 |
|
515 CurMinAngle:= 0; |
|
516 CurMaxAngle:= cMaxAngle; |
511 StoreCnt:= 0; |
517 StoreCnt:= 0; |
512 ammoLoadout:= ''; |
518 ammoLoadout:= ''; |
513 ammoProbability:= ''; |
519 ammoProbability:= ''; |
514 ammoDelay:= ''; |
520 ammoDelay:= ''; |
515 ammoReinforcement:= ''; |
521 ammoReinforcement:= ''; |