Yes, it helps grin

After reading those C++ tutorials last week, I tried static_cast<> now in SED and faced a slap.

I tried casting to var "(var)glock", but I also got an error, dunno what went wrong, but seeing your reply and remembering I've seen this used before, makes me think I did something else wrong. It said, if I remember, I cant cast a struct to a fixed point...or something... laugh
But, I also tried _VAR(glock), after again false memory, and it didn't work also.

BUT! Let me give it another try tomorrow laugh

And, let me see if I got this right (learned it enough?):
Code:
var v = *((var*)(&((int)1)));  // all the bits are 0 but the last


You are casting a var literal into an int, dereferencing the address of an int, casting the address of an int to a var address and assigning the address to that address to an actual var (into v), right? I think I got something wrong...

PS.: my weaponsList is a global array of WEAPONSTRUCT*s and I'm just initializing each weapon (malloc) in a function upon start and assigning it to a member of the global array.
I'm doing it this way, instead with global structs, because my intention is to achieve a system that could create dynamically weapons later (based on a web database for example). I'm aiming for a Diablo style prefix/suffix random drops...
But I haven't dealt with structs much yet... laugh

Thanks for helping, by the way.

Last edited by EpsiloN; 12/15/15 21:44.

Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201