Difference between revisions of "Script Function: Cleanup"

From Ultima Online: The Second Age
Jump to: navigation, search
Line 16: Line 16:
 
       [[Engine Function:_getContents|<span style="color:#FF0000;font-weight:bold">getContents</span>]](Q4E4, this);
 
       [[Engine Function:_getContents|<span style="color:#FF0000;font-weight:bold">getContents</span>]](Q4E4, this);
 
       <span style="color:#0000FF">while</span>([[Engine Function:_numInList|<span style="color:#FF0000;font-weight:bold">numInList</span>]](Q4E4))
 
       <span style="color:#0000FF">while</span>([[Engine Function:_numInList|<span style="color:#FF0000;font-weight:bold">numInList</span>]](Q4E4))
      {
 
        <span style="color:#0000FF">list</span> args;
 
        [[Engine Function:_message|<span style="color:#FF0000;font-weight:bold">message</span>]](Q4E4[0x00], <span style="color:#800000">"cleanup"</span>, args);
 
        [[Engine Function:_removeItem|<span style="color:#FF0000;font-weight:bold">removeItem</span>]](Q4E4, 0x00);
 
      }
 
    }
 
    [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"vendedOwner"</span>);
 
    [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"vendedPrice"</span>);
 
    [[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"description"</span>);
 
    [[Engine Function:_detachScript|<span style="color:#FF0000;font-weight:bold">detachScript</span>]](this, <span style="color:#800000">"vended"</span>);
 
    <span style="color:#0000FF">return</span> ();
 
  }
 
 
  <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> cleanup()
 
  {
 
    <span style="color:#0000FF">if</span> ([[Engine Function:_isContainer|<span style="color:#FF0000;font-weight:bold">isContainer</span>]](this))
 
    {
 
      <span style="color:#0000FF">list</span> Q4E4;
 
      [[Engine Function:_getContents|<span style="color:#FF0000;font-weight:bold">getContents</span>]](Q4E4, this);
 
      while([[Engine Function:_numInList|<span style="color:#FF0000;font-weight:bold">numInList</span>]](Q4E4))
 
 
       {
 
       {
 
         <span style="color:#0000FF">list</span> args;
 
         <span style="color:#0000FF">list</span> args;

Revision as of 04:02, 8 October 2018

 function void cleanup()
 {
   removeObjVar(this, "lastCriminal");
   removeObjVar(this, "lastVictim");
   removeObjVar(this, "crimeSeverity");
   removeObjVar(this, "crimeLocation");
   detachScript(this, "witness");
   return ();
 }
 function void cleanup()
 {
   if (isContainer(this))
   {
     list Q4E4;
     getContents(Q4E4, this);
     while(numInList(Q4E4))
     {
       list args;
       message(Q4E4[0x00], "cleanup", args);
       removeItem(Q4E4, 0x00);
     }
   }
   removeObjVar(this, "vendedOwner");
   removeObjVar(this, "vendedPrice");
   removeObjVar(this, "description");
   detachScript(this, "vended");
   return ();
 }