Skip to content

Commit 2d30a70

Browse files
committed
update std.zh: fix FireE/LWeapon functions
1 parent 7a80aca commit 2d30a70

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

resources/include/std_zh/std_functions.zh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3916,6 +3916,7 @@ eweapon FireEWeaponAngle(int type, int x, int y, int radians, int step, int dmg,
39163916

39173917
weap->Angle = radians;
39183918
weap->Angular = true;
3919+
weap->Dir = AngleDir8(weap->DegAngle); //For shields
39193920
return weap;
39203921
}
39213922
eweapon FireEWeaponDegAngle(int type, int x, int y, int degrees, int step, int dmg, int sprite = -1, int sfx = 0, int scriptid = 0, untyped args = NULL)
@@ -3928,6 +3929,7 @@ eweapon FireEWeaponDegAngle(int type, int x, int y, int degrees, int step, int d
39283929

39293930
weap->DegAngle = degrees;
39303931
weap->Angular = true;
3932+
weap->Dir = AngleDir8(degrees); //For shields
39313933
return weap;
39323934
}
39333935
eweapon FireEWeaponDir(int type, int x, int y, int dir, int step, int dmg, int sprite = -1, int sfx = 0, int scriptid = 0, untyped args = NULL)
@@ -3950,11 +3952,10 @@ eweapon FireEWeaponAtHero(int type, int x, int y, bool angular, int step, int dm
39503952
if(sfx) Audio->PlaySound(sfx);
39513953

39523954
weap->Angular = angular;
3953-
int angle = Angle(x,y,Hero->X,Hero->Y);
3955+
int degrees = Angle(x,y,Hero->X,Hero->Y);
39543956
if(angular)
3955-
weap->Angle = angle;
3956-
else
3957-
weap->Dir = AngleDir8(angle);
3957+
weap->DegAngle = degrees;
3958+
weap->Dir = AngleDir8(degrees);
39583959
return weap;
39593960
}
39603961

@@ -3968,6 +3969,7 @@ lweapon FireLWeaponAngle(int type, int x, int y, int radians, int step, int dmg,
39683969

39693970
weap->Angle = radians;
39703971
weap->Angular = true;
3972+
weap->Dir = AngleDir8(weap->DegAngle); //For shields
39713973
return weap;
39723974
}
39733975
lweapon FireLWeaponDegAngle(int type, int x, int y, int degrees, int step, int dmg, int sprite = -1, int sfx = 0, int scriptid = 0, untyped args = NULL)
@@ -3980,6 +3982,7 @@ lweapon FireLWeaponDegAngle(int type, int x, int y, int degrees, int step, int d
39803982

39813983
weap->DegAngle = degrees;
39823984
weap->Angular = true;
3985+
weap->Dir = AngleDir8(degrees); //For shields
39833986
return weap;
39843987
}
39853988
lweapon FireLWeaponDir(int type, int x, int y, int dir, int step, int dmg, int sprite = -1, int sfx = 0, int scriptid = 0, untyped args = NULL)

0 commit comments

Comments
 (0)