View Issue Details

IDProjectCategoryView StatusLast Update
0007359Multi Theft Auto : San AndreasServerpublic2015-08-17 12:12
ReporterTAPLAssigned Tosbx320 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target Version1.5.1Fixed in Version1.5.1 
Summary0007359: createMarker triggers onMarkerHit
Description

The Event "onMarkerHit" get triggered by a marker that's created from createMarker.

Steps To Reproduce

addCommandHandler("testmkr",function()
createMarker(100,100,100)
end)

addEventHandler("onMarkerHit", root,
function()
outputChatBox(getElementType(source))
end)

TagsNo tags attached.

Activities

lil_Toady

2012-09-30 22:02

administrator   ~~0017655

And what's wrong about that? When a marker is created, some elements appear within it's boundary, so onMarkerHit gets triggered?

TAPL

2012-09-30 22:05

viewer   ~~0017656

Nope, i have stopped every resources with command "stopall" and then i start the Test code, and i write /xx

i can see "Yes" in chat box, and it's getting double each time i write /xx

lil_Toady

2012-09-30 22:07

administrator   ~~0017657

Last edited: 2012-09-30 22:07

Well, have you checked what element triggers the event? And no wonder there appears more of them, one marker appears within the other.

TAPL

2012-09-30 22:09

viewer   ~~0017658

Yes, it say "marker"

look like the marker trigger itself.

TAPL

2012-09-30 22:14

viewer   ~~0017660

There are one marker in the server, The marker triggering itself

i even try with this:

addEventHandler("onMarkerHit", root,
function(p)
outputChatBox("Yes")
outputChatBox(getElementType(p))
outputChatBox(#getElementsByType("marker"))
end)

and the result:

Yes
marker
1

W

2012-09-30 22:19

viewer   ~~0017661

I can reproduce this, creating a marker instantly triggers onMarkerHit on itself.

Test resource: http://lss-rp.pl/_/7359.zip

But is this a feature or a bug?

arranTuna

2012-10-04 17:40

manager   ~~0017679

The marker representation hitting the marker colshape? There's no reason why a scripter would want a marker to trigger onMarkerHit on itself.

TAPL, if you're getting debug warnings/errors it means you need element type checking on your onMarkerHit's which are always needed regardless of whether this bug exists or not.

TAPL

2012-10-04 18:37

viewer   ~~0017680

That right, i already checked, but i only check if the element were vehicle or not because i put in my mind there will not be anything other than vehicle and player will hit the marker according to the place where the marker is created.

if getElementType(player) == "vehicle" then return end

That's how i discovered the bug.

sbx320

2015-08-13 18:01

administrator   ~~0023921

Fixed in https://github.com/multitheftauto/mtasa-blue/commit/b8c5f85ed000f59a4f5ddd85d2b45c2c7dc50e98

Issue History

Date Modified Username Field Change