ID:2513707
 
Obj Coding...
obj/duel_obj
name = "-"
icon = 'd_stats.dmi'
icon_state = ""

var/duel_type = ""
var/spectate = 0
var/mob/d_mob

Click()

if(usr.isduel) return
if(usr.isbusy) return
if(usr.looking) return
if(!d_mob.name) return
if(!d_mob.dir) return



if(!spectate)
//-------------------------------------------------------------------------------------
var/xx = d_mob.x
var/yy = d_mob.y
var/zz = d_mob.z

switch(d_mob.dir)
if(NORTH)
yy += 8
if(SOUTH)
yy -= 8
if(EAST)
xx += 8
if(WEST)
xx -= 8

if(zz == 3 || zz == 5 || zz == 6 || zz == 7)
return

if(usr.z == 3 || usr.z == 5 || usr.z == 6 || usr.z == 7)
return

var/turf/T = locate(xx,yy,zz)
if(T.density) return

for(var/mob/MXX in world)
if(MXX.x == xx && MXX.y == yy && MXX.z == zz)
return

var/oo = usr.density
var/ooo = usr.alpha // Whatever your Alpha was before you warped

usr.density = 0
usr.alpha = 0

var/obj/WARP_PORTAL_S/P = new(1)
P.loc = locate(xx,yy,zz)
usr.alpha = 0

usr.density = 0
usr.Move(locate(xx,yy,zz))
usr.density = oo

switch(d_mob.dir)
if(NORTH)
usr.dir = SOUTH
if(SOUTH)
usr.dir = NORTH
if(EAST)
usr.dir = WEST
if(WEST)
usr.dir = EAST

if(istype(loc, /turf/KTOWER/diag_zone))
for(var/turf/KTOWER/diag_zone/d_turf in world)
if(d_turf.x == usr.x && d_turf.y == usr.y && d_turf.z == usr.z)
if(d_turf.diag_dir == "NW" || d_turf.diag_dir == "NE")
usr.dir = NORTH
if(d_turf.diag_dir == "SW" || d_turf.diag_dir == "SE")
usr.dir = SOUTH

spawn()
for(var/ii=0;ii<ooo;ii+=12)
if(usr.isduel) break
alpha = ii
sleep(1)
usr.alpha = ooo


if(spectate)
usr.Look(d_mob)

return


Stat Panel Coding...
        statpanel("Duels")

if(statpanel("Duels"))

var/duels = 0

var/list/d_stat_list = list()

for(var/client/D) if(D.mob) if(D.mob.isduel)
var/TO_Format = "OCG"
if(D.mob.C_Format == 1) TO_Format = "TCG"
if(D.mob.C_Format == 3) TO_Format = "RANDOM"

var/obj/duel_obj/O = new()
O.d_mob = D.mob

if(D.mob.Opponents.len)
O.icon = 'd_stats.dmi'
if(D.mob.rated)
O.name = {"<font color=#ff0000>"}
O.icon_state = "rank"
else
O.name = {"<font color=#b54d4d>"}
O.icon_state = "full"
var/dup_check = 0
for(var/obj/OO in d_stat_list)
if(findtext(OO.name,D.mob.name))
dup_check = 1

if(!dup_check)
O.name += {"<b>[D.mob.name]</b>"}

if(D.mob.Partners.len) for(var/X in D.mob.Partners)
var/mob/M = D.mob.Partners[X]
if(!findtext(O.name,M.name))
O.name += {" and <b>[M.name]</b>"}

for(var/XX in D.mob.Opponents)
var/mob/M = D.mob.Opponents[XX]
if(!findtext(O.name,M.name))
O.name += {" -VS- <b>[M.name]</b>"}

if(M.Partners.len) for(var/X in M.Partners)
var/mob/MP = M.Partners[X]
if(!findtext(O.name,MP.name))
O.name += {" and <b>[MP.name]</b>"}
O.name += {"</font>"}

O.spectate = 1
d_stat_list += O

else
O.name = "<font color=#6bb54d><b>[D.mob.name] ([TO_Format]) - ([D.mob.x], [D.mob.y], [get_level(D.mob.x,D.mob.y,D.mob.z)])</b></font>"
O.icon = D.mob.cicon
O.icon_state = D.mob.icon_state
O.dir = SOUTH

d_stat_list += O

duels++
if(!duels)
stat("<font color=#F59A2F><b>No Players Dueling</b></font>","[FindPlayersNum()] Online")
else
for(var/O in d_stat_list)
if(d_stat_list.len > 1)
if(O != d_stat_list[1])
stat("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-")

stat(O)


So I'm sure there's a more efficient way of doing this but... I have a stat panel that shows a series of objects that have a click() function attached to them. Each object represents a single match between players in the game.

The click on them will do something different depending on if its a player waiting for an opponent or if its an ongoing match.

If a player is waiting for an opponent, clicking on the obj in the stat panel will teleport you to that player so you can play against them.

If its an ongoing match, it'll put you in spectator mode so you can watch the match.

Problem is, the...hitbox? on the objects dont seem to be entirely accurate. Players seem to have issues where, when they're trying to click on 1 line, it'll get treated as clicking one of the adjacent lines instead occasionally.

Any recommendations here?
It'd help a lot if you could make a demo for this so I could see it in action. If thee's a hitbox problem I should be able to isolate it from that.
I have made a demo, but I cant seem to isolate the problem. The players who have reported it, have been reporting it as an inconsistent issue.

I've noticed it from time to time myself. But I've always figured I just misclicked but its gotten to the point where i've had enough people report it that it feels like something is going on.

More consistent issues I've noticed are the clicks not being recognized at all. I've also noticed that the mouse-over highlight on the stat panel only lasts for a fraction of a second and disappears afterwards. I assume that happens when the panel refreshes and doesn't detect the mouseover again until the mouse moves again.

https://www.dropbox.com/s/7wgnhevezhj9f0v/st.rar?dl=0

Here's the demo link. But like I said, I can't seem to actually isolate the issue or get it to repeat with any kind of consistency.
mob/var/list/moblist
mob/var/updated = 0

mob/Stat()

statpanel("A Panel")
if(statpanel("A Panel"))
usr.updated = 0
stat("[usr.name]")

statpanel("Hitbox Test",usr.moblist)

if(statpanel("Hitbox Test"))
if(usr.updated == 0)
var/list/d_stat = list()

for(var/mob/dummy/M in world)
var/dup_check = 0

if(d_stat.len)
for(var/obj/X in d_stat)
if(findtext(X.name,M.name))
dup_check = 1

if(!dup_check)
var/obj/duel_obj/O = new()
O.d_mob = M
if(O.d_mob.opponent)
O.icon = 'd_stat.dmi'
O.icon_state = "vs"
O.name = "[O.d_mob.name] -VS- [O.d_mob.opponent]"

else
O.icon = O.d_mob.icon
O.icon_state = O.d_mob.icon_state
O.name = "[O.d_mob.name]"

d_stat += O

usr.moblist = d_stat
usr.updated = 1


do not know if you still have the problem?
or if this will fix it, still good luck