[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: Upcoming release



On 20.08.2004 15:44, FlashFashion wrote:
Jens Granseuer wrote:
> All bugs are mine.

Hey, maybe there is one.

When adding messages using comet, no space char is allowed?
Which would make the message look funny, like FreeNexusHQ.
Yes, that's not so nice.

There also is another problem with the prerelease: The new
timer events don't work. Or rather they work too well. All
timer related events are always triggered at the beginning
of a game :-( It's one of those situations when you think
"That's so simple, there's no chance I can get this wrong"
and don't bother testing...

I have attached a patch for those of you who use the source.
It fixes the timers, input of spaces and punctuation in
general in string boxes, and two other minor issues. I'm
afraid I won't get my hands on another Windows build any
time soon to correct the timers. For now just assume
everything works as advertised.

By the way, I have problem make old format map to work with new
cfed
What kind of problem is that?

Jens

diff -ur ../crimson-0.4.4pre/ChangeLog ./ChangeLog
--- ../crimson-0.4.4pre/ChangeLog	Tue Aug 17 19:45:59 2004
+++ ./ChangeLog	Fri Aug 20 18:49:42 2004
@@ -1,3 +1,14 @@
+2004-08-20  Jens Granseuer  <jensgr@gmx.net>
+
+	* src/cf/event.cpp (CheckTrigger): fix timer checks and also
+	search transporters for UNIT_POSITION
+
+	* src/cf/initwindow.cpp (GenericOptionsWindow::SetLayout):
+	limit maximum window height to screen size
+
+	* src/common/textbox.cpp (StringWidget::CharInput): accept
+	all printable characters as valid input
+
 2004-08-17  Jens Granseuer  <jensgr@gmx.net>
 
 	* src/cf/event.cpp (Execute)
diff -ur ../crimson-0.4.4pre/src/cf/event.cpp ./src/cf/event.cpp
--- ../crimson-0.4.4pre/src/cf/event.cpp	Tue Aug 17 18:59:38 2004
+++ ./src/cf/event.cpp	Thu Aug 19 21:09:56 2004
@@ -109,7 +109,7 @@
     switch ( e_trigger ) {
     case ETRIGGER_TIMER:
       // the event numbers "turns" starting with 0 with two phases each turn
-      rc = (e_tdata[0] >= mis->GetTime());
+      rc = (mis->GetTime() >= e_tdata[0]);
       break;
     case ETRIGGER_UNIT_DESTROYED:
       if ( e_tdata[0] == -1 ) {                                // destroy all enemy units to score
@@ -121,27 +121,40 @@
       }
       break;
     case ETRIGGER_HAVE_BUILDING:
-      if ( (e_tdata[2] == -1) || (e_tdata[2] >= mis->GetTime()) ) {
+      if ( (e_tdata[2] == -1) || (mis->GetTime() >= e_tdata[2]) ) {
         Building *b = mis->GetShop( e_tdata[0] );
         rc = ( b && b->Owner() && (b->Owner()->ID() == e_tdata[1]) );
       }
       break;
     case ETRIGGER_HAVE_UNIT:
-      if ( (e_tdata[2] == -1) || (e_tdata[2] >= mis->GetTime()) ) {
+      if ( (e_tdata[2] == -1) || (mis->GetTime() >= e_tdata[2]) ) {
         Unit *u = mis->GetUnit( e_tdata[0] );
         rc = ( u && u->Owner() && (u->Owner()->ID() == e_tdata[1]) );
       }
       break;
     case ETRIGGER_UNIT_POSITION: {
+      Unit *u;
       Point loc = mis->GetMap().Index2Hex(e_tdata[1]);
       if ( e_tdata[0] < 0 ) {
-        Unit *u = mis->GetMap().GetUnit( loc );
+        u = mis->GetMap().GetUnit( loc );
 
-        // -1 means any unit, -X is unit of type X - 2
-        rc = ( u && (u->Owner() == e_player) &&
-             ((e_tdata[0] == -1) || (u->Type()->ID() == -e_tdata[0] - 2)) );
+        if ( u && (u->Owner() == e_player) ) {
+          // -1 means any unit, -X is unit of type X - 2
+          if ( e_tdata[0] == -1 ) rc = true;
+          else {
+            unsigned char utype = -e_tdata[0] - 2;
+            if ( u->Type()->ID() == utype ) rc = true;
+            else if ( u->IsTransport() ) {
+              Transport *t = static_cast<Transport *>(u);
+              for ( int i = 0;
+                    ((u = t->GetUnit(i)) != NULL) && !rc; ++i ) {
+                rc = ( u->Type()->ID() == utype );
+              }
+            }
+          }
+        }
       } else {
-        Unit *u = mis->GetUnit( e_tdata[0] );
+        u = mis->GetUnit( e_tdata[0] );
         rc = ( u && (u->Owner() == e_player) && (u->Position() == loc) );
       }
       break; }
diff -ur ../crimson-0.4.4pre/src/cf/initwindow.cpp ./src/cf/initwindow.cpp
--- ../crimson-0.4.4pre/src/cf/initwindow.cpp	Sat Aug  7 16:09:49 2004
+++ ./src/cf/initwindow.cpp	Fri Aug 20 18:37:27 2004
@@ -672,6 +672,9 @@
 
   if ( w < tw + 20 ) w = tw + 20;
 
+  if ( h + 25 + lfont->Height() + sfont->Height() >= view->Height() )
+    h = view->Height() - lfont->Height() - sfont->Height() - 26;
+
   clientarea = Rect( 5, 13 + lfont->Height(), w, h );
 
   Window::SetSize( w + 10, h + lfont->Height() + sfont->Height() + 25 );
diff -ur ../crimson-0.4.4pre/src/common/textbox.cpp ./src/common/textbox.cpp
--- ../crimson-0.4.4pre/src/common/textbox.cpp	Wed Mar 24 18:36:24 2004
+++ ./src/common/textbox.cpp	Fri Aug 20 18:51:44 2004
@@ -505,7 +505,7 @@
       if ( buffer.size() < maxlen ) {   // insert char at cursor pos
         bool accept = (validator ?
                        validator->ValidateKey( buffer.c_str(), unicode, cursor ) :
-                       (isalnum(unicode) && (unicode<=127)) );
+                       isprint(unicode) != 0 );
         if ( accept ) {
           buffer.insert( cursor++, 1, unicode );
           changed = true;