Results 1 to 10 of 20

Thread: Procedural world generation - ground and traps seems to not generating.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    Quote Originally Posted by SilverWarior View Post
    When you are using multiconditional if statment all conditions get checked even if first condition isn't met already.
    This is not true. I can demonstrate that with simple example:
    Code:
    var sl: TStringList;
    begin
      sl:=nil;
      // Version 1: No errors
      if (sl<>nil) and (sl.Add('Test')>0) then exit;
      
      // Version 2: Runtime error
      //if (sl.Add('Test')>0) then exit;
    If-statement ends in the (sl<>nil) condition, because any further conditionals wouldn't change the logical end result. If there was OR, instead of AND, then it would have to proceed to next comparison because (sl<>nil)=false.

    edit: Have you double/triple-checked the drawing code, or done analyzing to the chunks to see if traps are actually generated, just hidden.
    Last edited by User137; 01-06-2013 at 08:09 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •