Skip to content

Commit

Permalink
Bomb carrier check
Browse files Browse the repository at this point in the history
  • Loading branch information
Jire committed Feb 5, 2017
1 parent 4992865 commit 21a885d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/main/kotlin/com/charlatano/game/entity/Bomb.kt
Expand Up @@ -39,7 +39,12 @@ internal fun Bomb.timeLeft(): Int = (-(engineDLL.float(dwGlobalVars + 16) - csgo

internal fun Bomb.planted() = this != -1L && !defused() && timeLeft() > 0

internal fun Bomb.carrier(): Player = (csgoEXE.int(this + hOwnerEntity) and 0xFFF) - 1L
internal fun Bomb.owner() = csgoEXE.uint(this + hOwnerEntity)

internal fun Bomb.carrier(): Player {
val owner = owner()
return if (owner > 0) (owner and 0xFFF) - 1L else 0
}

internal fun Bomb.planter(): Player = clientDLL.uint(dwEntityList + (carrier() * ENTITY_SIZE))

Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/com/charlatano/scripts/esp/BoxESP.kt
Expand Up @@ -53,7 +53,7 @@ internal fun boxEsp() = CharlatanoOverlay {
val boxW = boxH / 5F

val bomb: Entity = entityByType(EntityType.CC4)?.entity ?: -1
val c = if (bomb > -1 && entity == bomb.carrier()) Color.GREEN
val c = if (bomb > 0 && entity == bomb.carrier()) Color.GREEN
else if (me.team() == entity.team()) Color.BLUE else Color.RED

val sx = (vTop.x - boxW).toInt()
Expand Down

0 comments on commit 21a885d

Please sign in to comment.