Here is the prototype:
void RecvProxy_ToggleSights( const CRecvProxyData* pData, void* pStruct, void* pOut );
And then the function itself:
void RecvProxy_ToggleSights( const CRecvProxyData* pData, void* pStruct, void* pOut ){
CBaseCombatWeapon *pWeapon = (CBaseCombatWeapon*)pStruct;
if( pData->m_Value.m_Int )
pWeapon->EnableIronsights();
else
pWeapon->DisableIronsights();}
And then the error message this code, both the prototype and the definition, generates:
Error 19 error C4430: missing type specifier – int assumed. Note: C++ does not support default-int f:\Mods\CI Testbed\src\game\shared\basecombatweapon_shared.cpp 47
How can I resolve this error?
Is the type ‘CRecvProxyData’ defined? Your code is otherwise correct (assuming all user defined types are defined properly), although I suggest you place opening and closing braces for the function definition on their own lines.
Also, I take issue with void*: It’s a bit of a hangover from C, you should aim to eliminate it from your source code where necessary. Could you use polymorphism or templates instead?
It’s likely your missing a #include, or have made an error in your include guards. If you could post the contents of the filer where ‘CRecvProxyData’ is defined as well as the code surrounding that which you have posted, that would be a great help. Otherwise, I can only speculate :).