mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-29 23:33:00 +00:00
- fixed setup of ready state with Dehacked.
This needs to emulate the hard coded chainsaw sound when weapon states get reassigned.
This commit is contained in:
parent
972e9cba09
commit
431c47c957
2 changed files with 21 additions and 1 deletions
|
@ -2066,6 +2066,7 @@ static int PatchWeapon (int weapNum)
|
||||||
Printf ("Weapon %d out of range.\n", weapNum);
|
Printf ("Weapon %d out of range.\n", weapNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FState* readyState = nullptr;
|
||||||
while ((result = GetLine ()) == 1)
|
while ((result = GetLine ()) == 1)
|
||||||
{
|
{
|
||||||
int val = atoi (Line2);
|
int val = atoi (Line2);
|
||||||
|
@ -2085,8 +2086,11 @@ static int PatchWeapon (int weapNum)
|
||||||
statedef.SetStateLabel("Select", state);
|
statedef.SetStateLabel("Select", state);
|
||||||
else if (strnicmp (Line1, "Select", 6) == 0)
|
else if (strnicmp (Line1, "Select", 6) == 0)
|
||||||
statedef.SetStateLabel("Deselect", state);
|
statedef.SetStateLabel("Deselect", state);
|
||||||
else if (strnicmp (Line1, "Bobbing", 7) == 0)
|
else if (strnicmp(Line1, "Bobbing", 7) == 0)
|
||||||
|
{
|
||||||
|
readyState = state;
|
||||||
statedef.SetStateLabel("Ready", state);
|
statedef.SetStateLabel("Ready", state);
|
||||||
|
}
|
||||||
else if (strnicmp (Line1, "Shooting", 8) == 0)
|
else if (strnicmp (Line1, "Shooting", 8) == 0)
|
||||||
statedef.SetStateLabel("Fire", state);
|
statedef.SetStateLabel("Fire", state);
|
||||||
else if (strnicmp (Line1, "Firing", 6) == 0)
|
else if (strnicmp (Line1, "Firing", 6) == 0)
|
||||||
|
@ -2197,6 +2201,20 @@ static int PatchWeapon (int weapNum)
|
||||||
|
|
||||||
if (info)
|
if (info)
|
||||||
{
|
{
|
||||||
|
// Emulate the hard coded ready sound of the chainsaw as good as possible.
|
||||||
|
if (readyState)
|
||||||
|
{
|
||||||
|
FState* state = FindState(67); // S_SAW
|
||||||
|
if (readyState == state)
|
||||||
|
{
|
||||||
|
info->IntVar(NAME_ReadySound) = S_FindSound("weapons/sawidle");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
info->IntVar(NAME_ReadySound) = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (info->PointerVar<PClassActor>(NAME_AmmoType1) == nullptr)
|
if (info->PointerVar<PClassActor>(NAME_AmmoType1) == nullptr)
|
||||||
{
|
{
|
||||||
info->IntVar(NAME_AmmoUse1) = 0;
|
info->IntVar(NAME_AmmoUse1) = 0;
|
||||||
|
|
|
@ -279,6 +279,8 @@ xx(DropTime)
|
||||||
xx(PickupSound)
|
xx(PickupSound)
|
||||||
xx(WeaponScaleX)
|
xx(WeaponScaleX)
|
||||||
xx(WeaponScaleY)
|
xx(WeaponScaleY)
|
||||||
|
xx(ReadySound)
|
||||||
|
xx(A_WeaponReady)
|
||||||
|
|
||||||
// PlayerPawn member fields
|
// PlayerPawn member fields
|
||||||
xx(ColorRangeStart)
|
xx(ColorRangeStart)
|
||||||
|
|
Loading…
Reference in a new issue