Revert "Make Address a int64 if <virtual_address> is included (#2407)"
This reverts commit 2b5554a21d.
This commit is contained in:
@@ -90,7 +90,7 @@ enum SDKType
|
||||
SDKType_Edict, /**< edict_t (always as pointer) */
|
||||
SDKType_String, /**< NULL-terminated string (always as pointer) */
|
||||
SDKType_Bool, /**< Boolean (any) */
|
||||
SDKType_VirtualAddress, /**< SM Virtual Address (unavailable if plugin doesn't include <virtual_address>) */
|
||||
SDKType_VirtualAddress, /**< SM Virtual Address */
|
||||
};
|
||||
|
||||
enum SDKPassMethod
|
||||
@@ -192,7 +192,6 @@ native Handle EndPrepSDKCall();
|
||||
* If the return value is a Vector or QAngles, the SECOND parameter must be a Float[3].
|
||||
* If the return value is a string, the THIRD parameter must be a String buffer, and the
|
||||
* FOURTH parameter must be the maximum length.
|
||||
* If the return value is a Virtual Address, the SECOND parameter must be an Address variable.
|
||||
* All parameters must be passed after the above is followed. Failure to follow these
|
||||
* rules will result in crashes or wildly unexpected behavior!
|
||||
*
|
||||
|
||||
@@ -78,20 +78,6 @@ struct Plugin
|
||||
#include <commandline>
|
||||
#include <entitylump>
|
||||
|
||||
#if defined _virtual_address_included
|
||||
typedef Address = int64;
|
||||
public const int64 __Int64_Address__ = 0;
|
||||
|
||||
/**< Equivallent to nullptr */
|
||||
public const int64 Address_Null = 0;
|
||||
/**< Size of a pointer in bytes (same as `sizeof(void*)`) */
|
||||
public const int64 Address_PointerSize = 0;
|
||||
#else
|
||||
enum Address {
|
||||
Address_Null = 0
|
||||
};
|
||||
#endif
|
||||
|
||||
enum APLRes
|
||||
{
|
||||
APLRes_Success = 0, /**< Plugin should load */
|
||||
@@ -739,6 +725,11 @@ enum NumberType
|
||||
NumberType_Int32
|
||||
};
|
||||
|
||||
enum Address
|
||||
{
|
||||
Address_Null = 0 // a typical invalid result when an address lookup fails
|
||||
};
|
||||
|
||||
/**
|
||||
* Load up to 4 bytes from a memory address.
|
||||
*
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* vim: set ts=4 :
|
||||
* =============================================================================
|
||||
* SourceMod (C)2026 AlliedModders LLC. All rights reserved.
|
||||
* SourceMod (C)2004-2025 AlliedModders LLC. All rights reserved.
|
||||
* =============================================================================
|
||||
*
|
||||
* This file is part of the SourceMod/SourcePawn SDK.
|
||||
@@ -35,15 +35,5 @@
|
||||
#endif
|
||||
#define _virtual_address_included
|
||||
|
||||
#if defined _sourcemod_included
|
||||
#error <virtual_address> must be included before <sourcemod>!
|
||||
#endif
|
||||
|
||||
// Including this file in your plugin will turn on SM's Virtual Address
|
||||
//
|
||||
// For pointer-sized reading/storage, we recommend the usage of
|
||||
// - LoadAddressFromAddress over LoadFromAddress
|
||||
// - StoreAddressToAddress over StoreToAddress
|
||||
//
|
||||
// For SDKCalls involving raw pointers, we discourage the usage of
|
||||
// - SDKType_PlainOldData (32 bits wide) - Use SDKType_VirtualAddress instead
|
||||
public const Address __Virtual_Address__ = view_as<Address>(0);
|
||||
public const Address PointerSize = view_as<Address>(0); /**< Size of a pointer in bytes (same as `sizeof(void*)`) */
|
||||
|
||||
Reference in New Issue
Block a user