@@ -1549,34 +1549,43 @@ bool SendVarEdit::SDK_OnLoad(char* error, size_t maxlength, bool late)
1549
1549
1550
1550
// fill out game info struct
1551
1551
{
1552
- gameconf->GetOffset (" CEntityWriteInfo entity" , &g_gameinfo.struct_EWI .entity );
1553
- gameconf->GetOffset (" CEntityWriteInfo output" , &g_gameinfo.struct_EWI .output );
1554
- gameconf->GetOffset (" CEntityWriteInfo client" , &g_gameinfo.struct_EWI .client );
1555
- gameconf->GetOffset (" CEntityWriteInfo oldpack" , &g_gameinfo.struct_EWI .oldpack );
1556
- gameconf->GetOffset (" CEntityWriteInfo newpack" , &g_gameinfo.struct_EWI .newpack );
1552
+ bool all_offsets = true ;
1553
+ bool all_variables = true ;
1557
1554
1558
- g_variables.GetVariable (" SV_DetermineUpdateType entitywriteinfo" , &g_gameinfo.vars_DUT .entitywriteinfo );
1559
- g_variables.GetVariable (" SV_DetermineUpdateType propcount" , &g_gameinfo.vars_DUT .propcount );
1555
+ all_offsets &= gameconf->GetOffset (" CEntityWriteInfo entity" , &g_gameinfo.struct_EWI .entity );
1556
+ all_offsets &= gameconf->GetOffset (" CEntityWriteInfo output" , &g_gameinfo.struct_EWI .output );
1557
+ all_offsets &= gameconf->GetOffset (" CEntityWriteInfo client" , &g_gameinfo.struct_EWI .client );
1558
+ all_offsets &= gameconf->GetOffset (" CEntityWriteInfo oldpack" , &g_gameinfo.struct_EWI .oldpack );
1559
+ all_offsets &= gameconf->GetOffset (" CEntityWriteInfo newpack" , &g_gameinfo.struct_EWI .newpack );
1560
+
1561
+ all_variables &= g_variables.GetVariable (" SV_DetermineUpdateType entitywriteinfo" , &g_gameinfo.vars_DUT .entitywriteinfo );
1562
+ all_variables &= g_variables.GetVariable (" SV_DetermineUpdateType propcount" , &g_gameinfo.vars_DUT .propcount );
1560
1563
1561
1564
if (!gameconf->GetMemSig (" SV_DetermineUpdateType props changed call" , &g_gameinfo.points_DUT .props_changed_call ))
1562
1565
RETURN_ERROR (" Failed to find SV_DetermineUpdateType props changed call." );
1563
1566
1564
1567
if (!gameconf->GetMemSig (" SV_DetermineUpdateType positive propcount block" , &g_gameinfo.points_DUT .propcount_positive_block ))
1565
1568
RETURN_ERROR (" Failed to find SV_DetermineUpdateType positive propcount block." );
1566
1569
1567
- g_variables.GetVariable (" SendTable_WritePropList table" , &g_gameinfo.vars_WPL .table );
1568
- g_variables.GetVariable (" SendTable_WritePropList output" , &g_gameinfo.vars_WPL .output );
1569
- g_variables.GetVariable (" SendTable_WritePropList propindex" , &g_gameinfo.vars_WPL .propindex );
1570
- g_variables.GetVariable (" SendTable_WritePropList output_lastpropindex" , &g_gameinfo.vars_WPL .output_lastpropindex );
1570
+ all_variables &= g_variables.GetVariable (" SendTable_WritePropList table" , &g_gameinfo.vars_WPL .table );
1571
+ all_variables &= g_variables.GetVariable (" SendTable_WritePropList output" , &g_gameinfo.vars_WPL .output );
1572
+ all_variables &= g_variables.GetVariable (" SendTable_WritePropList propindex" , &g_gameinfo.vars_WPL .propindex );
1573
+ all_variables &= g_variables.GetVariable (" SendTable_WritePropList output_lastpropindex" , &g_gameinfo.vars_WPL .output_lastpropindex );
1571
1574
1572
1575
if (!gameconf->GetMemSig (" SendTable_WritePropList loop continue" , &g_gameinfo.points_WPL .loop_continue ))
1573
1576
RETURN_ERROR (" Failed to find SendTable_WritePropList loop continuation point." );
1574
1577
1575
1578
if (!gameconf->GetAddress (" &g_PropTypeFns" , (void **)&g_gameinfo.proptypefns ))
1576
1579
RETURN_ERROR (" Failed to find g_PropTypeFns." );
1577
1580
1578
- gameconf->GetOffset (" CSendTablePrecalc props" , &g_gameinfo.struct_STP .props );
1579
- gameconf->GetOffset (" CSendTablePrecalc propcount" , &g_gameinfo.struct_STP .propcount );
1581
+ all_offsets &= gameconf->GetOffset (" CSendTablePrecalc props" , &g_gameinfo.struct_STP .props );
1582
+ all_offsets &= gameconf->GetOffset (" CSendTablePrecalc propcount" , &g_gameinfo.struct_STP .propcount );
1583
+
1584
+ if (!all_offsets)
1585
+ RETURN_ERROR (" Missing offset in gamedata offsets." );
1586
+
1587
+ if (!all_variables)
1588
+ RETURN_ERROR (" Missing variable in gamedata variables." );
1580
1589
}
1581
1590
1582
1591
// hook CGameServer::SendClientMessages to catch when the server is about to network stuff to clients
0 commit comments