Fixed bullet cloning.

This commit is contained in:
genxium 2023-02-18 11:13:33 +08:00
parent 83419a6f23
commit a48e2f3cc0
4 changed files with 13 additions and 7556 deletions

View File

@ -518,7 +518,7 @@
"array": [
0,
0,
342.9460598986377,
216.50635094610968,
0,
0,
0,

View File

@ -33,7 +33,7 @@ cc.Class({
/** Init required prefab ended. */
self.inputFrameUpsyncDelayTolerance = 2;
self.collisionMinStep = 8;
self.collisionMinStep = 16;
self.renderCacheSize = 128;
self.serverFps = 60;

File diff suppressed because one or more lines are too long

View File

@ -819,7 +819,7 @@ func ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(inputsBuffer *resolv.Rin
break
}
fireballBullet := nextRenderFrameFireballBullets[fireballBulletCnt]
CloneFireballBullet(prevFireball.BlState, prevFireball.FramesInBlState, prevFireball.VirtualGridX, prevFireball.VirtualGridY, prevFireball.DirX, prevFireball.DirY, prevFireball.VelX, prevFireball.VelY, prevFireball.Speed, prevFireball.BattleAttr.BulletLocalId, prevFireball.BattleAttr.OriginatedRenderFrameId, prevFireball.BattleAttr.OffenderJoinIndex, prevFireball.BattleAttr.TeamId, prevFireball.Bullet, fireballBullet)
CloneFireballBullet(prevFireball.BlState, prevFireball.FramesInBlState+1, prevFireball.VirtualGridX, prevFireball.VirtualGridY, prevFireball.DirX, prevFireball.DirY, prevFireball.VelX, prevFireball.VelY, prevFireball.Speed, prevFireball.BattleAttr.BulletLocalId, prevFireball.BattleAttr.OriginatedRenderFrameId, prevFireball.BattleAttr.OffenderJoinIndex, prevFireball.BattleAttr.TeamId, prevFireball.Bullet, fireballBullet)
if IsFireballBulletAlive(fireballBullet, currRenderFrame) {
if IsFireballBulletActive(fireballBullet, currRenderFrame) {
@ -856,10 +856,7 @@ func ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(inputsBuffer *resolv.Rin
break
}
meleeBullet := nextRenderFrameMeleeBullets[meleeBulletCnt]
meleeBullet.Bullet = prevMelee.Bullet
meleeBullet.BattleAttr = prevMelee.BattleAttr
meleeBullet.FramesInBlState = prevMelee.FramesInBlState + 1
meleeBullet.BlState = prevMelee.BlState
CloneMeleeBullet(prevMelee.BlState, prevMelee.FramesInBlState+1, prevMelee.BattleAttr.BulletLocalId, prevMelee.BattleAttr.OriginatedRenderFrameId, prevMelee.BattleAttr.OffenderJoinIndex, prevMelee.BattleAttr.TeamId, prevMelee.Bullet, meleeBullet)
if IsMeleeBulletAlive(meleeBullet, currRenderFrame) {
offender := currRenderFrame.PlayersArr[meleeBullet.BattleAttr.OffenderJoinIndex-1]