ecompile.exe problem pol-core-Beta-x64-2016-10-15

Bug reports and feature requests. New features can only be added to the current development version. Bug-fixes may be back-ported.

Current release: 099 / Current development: 100
Post Reply
guialtran
Grandmaster Poster
Posts: 120
Joined: Wed Jul 30, 2008 12:42 pm

ecompile.exe problem pol-core-Beta-x64-2016-10-15

Post by guialtran »

First of all, I'm sorry, I do not speak English.


I encountered a problem, when I was converting some old pol 95 scripts to the pol-core-Beta-x64-2016-10-15.

Using two constants within one (if (1 == 1)), generates an internal problem in the compiler.

The program does not know how to perform the function.
(PlayObjectCenteredEffectex), and when I put it.
(Print ("" + PlayObjectCenteredEffect (...))
Or the program closes.
20170410134009-0.dmp

Code: Select all

Use os;
Use uo;
program usea( character )
	erro(  Target( character )  );
endprogram

function erro( character )
	if( 1 == 1 )
		if(1 == 1)
			PlayObjectCenteredEffectex(character,14089,0,30);
		elseif( 2 == 1 )
			print(2);
		endif
	endif
endfunction
OR

Code: Select all

Use os;
Use uo;

const A := 1;
const B := 1;
const C := 2;
program usea( character )
	erro(  Target( character )  );
endprogram

function erro( character )
	if( A == B )
		if(B == A)
			//sleepms(1);
			print(""+PlayObjectCenteredEffect(character,14089,1,30));// CRASH POL
			//PlayObjectCenteredEffect(character,14089,0,30);
		elseif( B == C )
			print(2);
		endif
	endif
endfunction

Can someone tell me if this is normal?

It is forbidden to place two constants inside if (), example (if (1 == 1))?

i ADD arquive CRASH 20170410140946-0.dmp
Attachments
20170410140946-0.dmp
(70.07 KiB) Downloaded 208 times
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: ecompile.exe problem pol-core-Beta-x64-2016-10-15

Post by Yukiko »

I'm not sure what you are attempting to accomplish with the "if" statements but if you want the character to target an object and have the effect appear on the object you will need to assign a variable to the object reference returned by the function Target as in my example below:

Code: Select all

Use os;
Use uo;
program usea( character )
	var targ := Target( character );
	erro(targ);
endprogram

function erro( targ )
	if( 1 == 1 )
			PlayObjectCenteredEffectex(targ,14089,0,30);
			print(2);
		
	endif
endfunction
I will note that the effect only appeared when I targetted a mobile. It should appear for any object such as a dynamically (in game) placed item. When I added the "elseif(2 ==1)" after the PlayObjectCenteredEffectex statement I didn't get the flame effect either. See below:

However POL didn't crash when I ran your original code either. I used your first example.

This programme doesn't work.

Code: Select all

Use os;
Use uo;
program usea( character )
	var targ := Target( character );
	erro(targ);
endprogram

function erro( targ )
	if( 1 == 1 )
			PlayObjectCenteredEffectex(targ,14089,0,30);
	elseif(2 == 1)
			print(2);
		
	endif
endfunction
guialtran
Grandmaster Poster
Posts: 120
Joined: Wed Jul 30, 2008 12:42 pm

Re: ecompile.exe problem pol-core-Beta-x64-2016-10-15

Post by guialtran »

This program has no purpose.
I want to show that when you use this pol with this code, the pol crash.
And I mean that the compiler is generating a faulty code when I put constants inside the if ()
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: ecompile.exe problem pol-core-Beta-x64-2016-10-15

Post by Yukiko »

Oh. My apologies. You're doing the work of the angels, and a good bug tester; trying to break something we think works. :)

Also, it's good to find "crash points" because these are often exploited by hackers.

Thanks for pointing this out.

I thought your code looked strange :P Now I know why.
guialtran
Grandmaster Poster
Posts: 120
Joined: Wed Jul 30, 2008 12:42 pm

Re: ecompile.exe problem pol-core-Beta-x64-2016-10-15

Post by guialtran »

Was a very old pol 95 code (with problem) 2k lines
I've erased everything.
That was left
I hope it helped you.

I think it should generate a compilation error when the programmer puts 2 constants inside an if, because this does not make sense.

PS: Could you explain why this(crash) happens?
Post Reply