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

FF2 GetEngineTime error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MAGNAT2645
Senior Member
Join Date: Nov 2015
Location: AlliedMods.net
Old 04-01-2019 , 09:43   GetEngineTime error
Reply With Quote #1

Spams error like:
Code:
L 03/31/2019 - 23:17:58: [SM] Exception reported: Instruction contained invalid parameter
L 03/31/2019 - 23:17:58: [SM] Blaming: freaks\ff2_aon_pack1.ff2
L 03/31/2019 - 23:17:58: [SM] Call stack trace:
L 03/31/2019 - 23:17:58: [SM]   [1] Line 152, c:\games\tf2server\tf\addons\sourcemod\scripting\freaks\ff2_aon_pack1.sp::OnGameFrame
but only if there is GetEngineTime used.

Replaced GetEngineTime with GetGameTime and error just disappeared.

Part from code:
Code:
public void RSLD_Invoke(int client) {
	int iBoss = FF2_GetBossIndex( client );
	if ( iBoss == -1 )
		return;

	if ( g_flRSLD_ActiveUntil[ client ] == FAR_FUTURE ) { // only initialize if not already active
		if ( g_iRSLD_Flags[ client ] & RSLD_FLAG_UBER )
			TF2_AddCondition( client, TFCond_Ubercharged );
		if ( g_iRSLD_Flags[ client ] & RSLD_FLAG_INVINCIBILITY )
			SetEntProp( client, Prop_Data, "m_takedamage", 0 );
		if ( g_iRSLD_Flags[ client ] & RSLD_FLAG_MEGAHEAL )
			TF2_AddCondition( client, TFCond_MegaHeal );

		g_flRSLD_NextTickAt[ client ] = GetEngineTime();
	}

	// set or extend
	g_flRSLD_ActiveUntil[ client ] = GetEngineTime() + g_flRSLD_Duration[ client ];
        // ...
}
public void OnGameFrame() {
	if ( !g_bPluginActiveThisRound || !g_bRoundInProgress )
		return;

	if ( g_bRSLD_Active )
		RSLD_OnGameFrame();
}
public void RSLD_OnGameFrame() {
	float flCurTime = GetEngineTime();
        // ...
}
Decompiler also said ERROR PREPROCESSING! 4752 for RSLD_Invoke and RSLD_OnGameFrame (if used GetEngineTime).

I use stable SourceMod and compiler.
Code:
public PlVers __version =
{
	version = 5,
	filevers = "1.9.0.6276",
	date = "04/01/2019",
	time = "18:25:24"
};

 SourceMod Version Information:
    SourceMod Version: 1.9.0.6276
    SourcePawn Engine: 1.9.0.6276, jit-x86 (build 1.9.0.6276)
    SourcePawn API: v1 = 4, v2 = 12
    Compiled on: Mar 28 2019 17:52:18
    Built from: https://github.com/alliedmodders/sourcemod/commit/2bfc3499
    Build ID: 6276:2bfc3499
    http://www.sourcemod.net/
P.S. Compiled with AMS
__________________

Last edited by MAGNAT2645; 04-01-2019 at 09:46. Reason: Added AMS note
MAGNAT2645 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 04-21-2019 , 21:14   Re: GetEngineTime error
Reply With Quote #2

There isn't anything special about the native.

Did you try just recompiling? You might have bad binary.

What is AMS?
__________________
asherkin is offline
Batfoxkid
Senior Member
Join Date: Nov 2018
Location: ''On the map''
Old 04-22-2019 , 01:02   Re: GetEngineTime error
Reply With Quote #3

Quote:
Originally Posted by asherkin View Post
What is AMS?
Ability Management System, a subplugin to allow multiple boss rages.
__________________
Batfoxkid is offline
MAGNAT2645
Senior Member
Join Date: Nov 2015
Location: AlliedMods.net
Old 04-22-2019 , 11:27   Re: GetEngineTime error
Reply With Quote #4

I've tried to recompile many times after all small changes but error still appears. Other plugins (FF2 subplugins and not FF2 related plugins) uses GetEngineTime without any error.

I think that compiler can't process functions with GetEngineTime (i always use GetGameTime for my plugins but some subplugins uses GetEngineTime so i just leaved how it was originally).
__________________
MAGNAT2645 is offline
Reply


Thread Tools
Display Modes

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 09:21.


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