issue #26 resolved (someone is hoolding stale ingame context)

This commit is contained in:
minjaesong
2019-07-03 03:59:37 +09:00
parent 42dbaaa242
commit ae8d7a67f2
27 changed files with 116 additions and 81 deletions

View File

@@ -508,7 +508,7 @@ open class ActorHumanoid(
val timedJumpCharge = jumpFunc(MAX_JUMP_LENGTH, jmpCtr)
forceVec.y -= getJumpAcc(jumpPower, timedJumpCharge)
forceVec.y += getDrag(AppLoader.UPDATE_RATE.toFloat(), forceVec).y
forceVec.y += getDrag(AppLoader.UPDATE_RATE, forceVec).y
simYPos += forceVec.y // ignoring all the fluid drag OTHER THAN THE AIR

View File

@@ -215,7 +215,7 @@ class ActorInventory(@Transient val actor: Pocketed, var maxCapacity: Int, var c
actor.avStrength / 1000.0
else
1.0 // TODO variable: scale, strength
val swingDmgToFrameDmg = AppLoader.UPDATE_RATE.toFloat().toDouble() / actor.actorValue.getAsDouble(AVKey.ACTION_INTERVAL)!!
val swingDmgToFrameDmg = AppLoader.UPDATE_RATE.toDouble() / actor.actorValue.getAsDouble(AVKey.ACTION_INTERVAL)!!
// damage the item
newItem.durability -= (baseDamagePerSwing * swingDmgToFrameDmg).toFloat()

View File

@@ -23,7 +23,7 @@ open class ParticleBase(renderOrder: Actor.RenderOrder, val despawnUponCollision
/** Will NOT actually delete from the CircularArray */
@Volatile var flagDespawn = false
override fun run() = update(AppLoader.UPDATE_RATE.toFloat())
override fun run() = update(AppLoader.UPDATE_RATE)
var isNoSubjectToGrav = false
var dragCoefficient = 3.0

View File

@@ -28,7 +28,7 @@ interface Pocketed {
}
inventory.itemEquipped[item.equipPosition] = null
item.effectOnUnequip(AppLoader.UPDATE_RATE.toFloat())
item.effectOnUnequip(AppLoader.UPDATE_RATE)
}
fun unequipItem(itemID: ItemID?) {
@@ -56,7 +56,7 @@ interface Pocketed {
if (item.equipPosition >= 0) {
inventory.itemEquipped[item.equipPosition] = item.dynamicID
item.effectWhenEquipped(AppLoader.UPDATE_RATE.toFloat())
item.effectWhenEquipped(AppLoader.UPDATE_RATE)
}
// else do nothing
}

View File

@@ -11,13 +11,13 @@ class ThreadActorUpdate(val startIndex: Int, val endIndex: Int) : Runnable {
override fun run() {
for (i in startIndex..endIndex) {
val it = Terrarum.ingame!!.actorContainerActive[i]
it.update(AppLoader.UPDATE_RATE.toFloat())
it.update(AppLoader.UPDATE_RATE)
if (it is Pocketed) {
it.inventory.forEach { inventoryEntry ->
ItemCodex[inventoryEntry.item]?.effectWhileInPocket(AppLoader.UPDATE_RATE.toFloat())
ItemCodex[inventoryEntry.item]?.effectWhileInPocket(AppLoader.UPDATE_RATE)
if (it.equipped(inventoryEntry.item)) {
ItemCodex[inventoryEntry.item]?.effectWhenEquipped(AppLoader.UPDATE_RATE.toFloat())
ItemCodex[inventoryEntry.item]?.effectWhenEquipped(AppLoader.UPDATE_RATE)
}
}
}