Senior Member
Join Date: Nov 2015
Location: AlliedMods.net
|
12-26-2019
, 07:52
Re: Enum Structs Available This Holiday Season
|
#35
|
Quote:
Originally Posted by LeeStrong
Is anyone able to help with the above, like many others I'm running a fork of ckSurf which if using the latest SM compiler, will not compile due to the use of enums.
I'm not the most knowledgeable when it comes to the transitional syntax and I've been having trouble getting things to compile and function when making my own efforts to convert my fork of the timer.
Notepad++ isn't the most forthcoming either!
Sample of Code
Code:
enum MapZone
{
zoneId, // ID within the map
zoneType, // Types: Start(1), End(2), Stage(3), Checkpoint(4), Speed(5), TeleToStart(6), Validator(7), Checker(8), Stop(0)
zoneTypeId, // ID of the same type eg. Start-1, Start-2, Start-3...
Float:PointA[3],
Float:PointB[3],
Float:CenterPoint[3],
String:zoneName[128],
zoneGroup,
Vis,
Team,
Float:TeleportPosition[3],
Float:TeleportAngles[3]
}
Usage:
Code:
int g_mapZones[MAXZONES][MapZone]; // Map Zone array
if (g_mapZones[i][zoneType] == 3 && g_mapZones[i][zoneGroup] == zonegroup)
{
StageIds[amount] = i;
amount++;
}
The above is just some example usage, but there's a lot of work to be done with this timer to make it happy with the up to date syntax. Are there any relatively simple ways to convert the above without having to make too many modifications to how they are used within the code?
Many thanks in advance for anyones input on the above.
|
Code:
enum struct MapZone
{
int zoneId, // ID within the map
int zoneType, // Types: Start(1), End(2), Stage(3), Checkpoint(4), Speed(5), TeleToStart(6), Validator(7), Checker(8), Stop(0)
int zoneTypeId, // ID of the same type eg. Start-1, Start-2, Start-3...
float PointA[3],
float PointB[3],
float CenterPoint[3],
char zoneName[128],
int zoneGroup,
int Vis,
int Team,
float TeleportPosition[3],
float TeleportAngles[3]
}
MapZone g_mapZones[MAXZONES];
Example, instead of g_mapZones[i][zoneType] use g_mapZones[i].zoneType
__________________
Last edited by MAGNAT2645; 12-26-2019 at 07:53.
Reason: Added [CODE]
|
|