• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

a few questions

Status
Not open for further replies.
Level 3
Joined
May 19, 2008
Messages
32
hi

1) is unittype a handle that leaks? i guess yes
2) using CSCache engine, when many players may use the same spell, do i have to attach variables with to handles using a player dependent string?

e.g. Is this ok AttachInt(t,"label",someInt) or do i have to use something like AttachInt(t,"label"+I2S(PlayerId),someInt) to avoid GCache conflicts when several players use the same spell at the same time?

mainly it comes down to what the output of CS_H2I(h) is.


ty for help
 
Level 3
Joined
May 19, 2008
Messages
32
i dont think so ... unittype is a type of its own
Code:
constant native ConvertUnitType  takes integer returns unittype

in common.j its defined as a handle so i guess one has to null it
i think you confused it with the unitTypeId that works with unittype like PlayerId works with player
 
Level 10
Joined
Jun 26, 2005
Messages
236
Each constant unittype equals a different integer.

For example:
JASS:
constant unittype UNIT_TYPE_HERO = ConvertUnitType(0)

So...
JASS:
ConvertUnitType(0)
just returns
JASS:
UNIT_TYPE_HERO
 
Level 3
Joined
May 19, 2008
Messages
32
i dont know whether it leaks or not ...

but its definitely not an integer, but there is a one to one correspondence between unit types and integers


----------------------------------------------------------------------------
EDITED: for all who#d still like to know, unittype is a handle that we can but should not use according to vex ... dunno why but there is an easy way around it through that unittype-integer correspondence
 
Last edited:
Status
Not open for further replies.
Top