Raised This Month: $32 Target: $400
 8% 

Solved Enum or array inside query callback


Post New Thread Reply   
 
Thread Tools Display Modes
adma
Senior Member
Join Date: Oct 2015
Old 03-26-2019 , 22:39   Re: Enum or array inside query callback
Reply With Quote #11

Quote:
Originally Posted by Fyren View Post
Everything is still a cell. The only thing that changed was the syntax.
Oh wow, it is too. When I read "real data types" I auto assumed memory allocation was different also. Nice to know!
adma is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 03-27-2019 , 02:12   Re: Enum or array inside query callback
Reply With Quote #12

Quote:
Originally Posted by adma View Post
Oh wow, it is too. When I read "real data types" I auto assumed memory allocation was different also. Nice to know!
It's a property of the Pawn language. In Pawn, everything is a cell... and internally, a cell is just a 32-bit signed integer.
  • int is just a plain cell
  • Float / float is just an IEE754 single precision floating point value stored in a cell. Pawn / SourcePawn has special math operators for it that are automatically called when you do math involving a float.
  • String / char are just a cell array where it stuffs 4 chars into each cell. Regular Pawn uses a different syntax for packed strings, but they operate basically the same as SourcePawn's
  • Handles (including methodmaps derived from Handles) are just a C++ memory address, albeit safer than a C++ pointer because SM tracks which handles are valid.
  • enum structs (Old type and SM 1.10 type) are just a cell array with special language syntax surrounding them.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 03-27-2019 at 02:14.
Powerlord is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:11.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode