[DiscordArchive] totems ?
[DiscordArchive] totems ?
Archived author: Kiffy • Posted: 2023-09-11T09:28:50.708000+00:00
Original source
, in that example player* and unit* is compared but its fine as player is just a derived unit, compiler throws error for you as c++ statically typed and checks for type if its a problem
Archived author: <o> • Posted: 2023-09-11T09:32:40.193000+00:00
Original source
in TC it is fine to use pointer comparison to check if two entities are the same, what's dangerous is _storing_ pointers across a single update phase
Archived author: <o> • Posted: 2023-09-11T09:33:10.207000+00:00
Original source
as long as that list of players is destroyed immediately after use it's fine
Archived author: <o> • Posted: 2023-09-11T09:35:14.223000+00:00
Original source
be careful with things like void* casting if you ever find yourself in a situation where the compiler tells you a comparison or cast isn't possible, usually it's for good reason e.g. virtual inheritance
Archived author: <o> • Posted: 2023-09-11T09:36:00.158000+00:00
Original source
that's for when you're dealing with raw memory as pod types and similar
Archived author: Kiffy • Posted: 2023-09-11T09:41:10.695000+00:00
Original source
I didnt know it was dangerous to store them across updates, whys that