View Issue Details

IDProjectCategoryView StatusLast Update
0005121Multi Theft Auto : San AndreasClientpublic2009-12-11 04:38
ReporterExploitAssigned Toccw 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version1.0.2 
Target Version1.0.3Fixed in Version1.0.3 
Summary0005121: When a colshape is created, getElementsWithinColShape() and isElementWithinColShape() doesnt find player if player does not move
Description

getElementsWithinColShape() doesn't find the player if the player is not moving.
Same for isElementWithinColShape() which returns false if the player is not moving even if he is in the colshape.

Steps To Reproduce
  1. Make a timer that creates a colshape at the players position every 1/2 second
  2. Make another timer that get's which players are in that colshape every second
  3. Add some outputChatBox() to get what the buged functions return

You'll notice they'll return true if the player is moving and is in the colshape and false if they are in the colshape but still

Additional Information
  1. This could be happening because the colshape is updating every 1/2 second, deleting and recreating ( Although it doesn't make a lot of sence since it finds the player all the time if he moves ).
  2. This might be happening server side too ( haven't tried it )
  3. Uploaded file contains an isElementWithinColShape() client code reproducing example
TagsNo tags attached.

Relationships

related to 0005129 resolvedccw getElementsWithinColshape is buggy if you move the colshape position server or client side 

Activities

ccw

2009-12-04 16:04

administrator   ~~0010830

After testing, it would appear that when a colshape is created, elements already existing at that location do not collide with it until after they first move. Existing scripts might depend on this, so it needs to be fixed with caution. The behaviour ought to be documented though.

ccw

2009-12-11 04:37

administrator   ~~0010844

Last edited: 2009-12-18 20:00

Fixed in 1.0.3-rc-4 with http://github.com/multitheftauto/multitheftauto/commit/598c6c31705f761b8f261b94e3c442d29a183f30

Edit:
To ensure compatibility with existing scripts, colShapes created on the client do not collide with elements already existing at that location until they first move.

Issue History

Date Modified Username Field Change