|
||
|
|||||||
| Modification Suggestions This is where you can suggest a modifcation to RunUO! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Forum Expert
|
When you use a sort of 'multi' command with a conditional clause it stops at first erroneous object.
I mean, for example I want to search for all players whose combatant is named "JohnDoe", so I use a command like this [global interface where playermobile combatant.name = 'JohnDoe' As soon as I run this command a nullref exception pops out. The problem is that not every playermobile has a combatant, so their combatant is null, the method call to get_Name fails and an exception is thrown. I did a little research on this issue: Code:
public void FinishCall()
{
CallInfo call = m_Calls.Pop();
if ( ( call.type.IsValueType || call.type.IsByRef ) && call.method.DeclaringType != call.type )
m_Generator.Emit( OpCodes.Constrained, call.type );
if ( call.method.DeclaringType.IsValueType || call.method.IsStatic )
m_Generator.Emit( OpCodes.Call, call.method );
else
m_Generator.Emit( OpCodes.Callvirt, call.method );
for ( int i = call.parms.Length - 1; i >= 0; --i )
Pop( call.parms[i].ParameterType );
if ( ( call.method.CallingConvention & CallingConventions.HasThis ) != 0 )
Pop( call.method.DeclaringType );
if ( call.method.ReturnType != typeof( void ) )
Push( call.method.ReturnType );
}
So, my suggestion is to check the TOS for a null value before the Callvirt or implement a different sanity check somewhere else. EDIT: Removed some code, it didn't work. It could probably be fixed by a try-catch somewhere where the conditions are interpreted.
__________________
Angels are falling the very last time, down they're burning in hate and decline, unfaithful and violent we're breaking the spell, we're god, we're scissor, in heaven and hell! Last edited by arul; 11-05-2007 at 01:45 PM. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|