Weird player rotation & boss titans not breaking blades(fix)

╮(╯_╰)╭ ok...I know there're tons of bugs....( ̄▽ ̄)~*
- Made by Feng, title edited by Accelevi

Weird player rotation & boss titans not breaking blades(fix)

Postby Josh » Sat Jan 03, 2015 9:36 pm

Not sure if I should PM a mod for this but I will in the future if that's better, these are fixes for the bugs I found.

Weird player rotation:

Since the 12-30 update other players have had shaky or wrong rotation over the network, there is only one script which
handles other player position/rotation/velocity over the network (SmoothSyncMovement) so I looked into it. It turns out
there's a targetRotation variable that the player script rotates the player to, when it's not your player it still constantly
tries to rotate which conflicts with SmoothSyncMovement. The fix is to only run the rotating code if that player's photon
view belongs to your client (as well as a singleplayer check as there's no PhotonView in SP):

At the bottom of HERO - lateUpdate()

if ((IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE || base.photonView.IsMine) && (!base.animation.IsPlaying("attack3_2") && !base.animation.IsPlaying("attack5")) && !base.animation.IsPlaying("special_petra"))
base.transform.rotation = Quaternion.Lerp(base.transform.rotation, this.targetRotation, Time.deltaTime * 6f);

Blades not breaking/double hitting boss titans:

At first I thought this was intentional but looking at the code it probably isn't. Since you have two blades you always hit titans twice, either hitting will
degrade both blades at the same rate. When hitting a boss titan the maximum possible 32 bit integer value is passed to the method that degrades the blades
to break them instantly, this was fine in previous versions but since 12-30 or so the value gets multiplied by 2 in said method which causes an arithmetic overflow
(in this case the value wraps around to the lowest possible integer value and goes from there), resulting in -2. This would just be a matter of only multiplying the amount
if it's less than the maximum integer value.

Code: Select all
public void useBlade(int amount = 0)
 ­   {
        ­if (amount == 0)
            amount = 1;
        if(amount < int.MaxValue)
        amount *= 2;
        //Rest of the code

Due to the size of boss colliders you hit outside of the nape too which degrades your blades, at the moment if your blades only
touch the nape of the boss titan and no other colliders your blade "stamina" (not sure what to call it) should theoretically increase instead of degrade.


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests