bugFreeciv - Bugs: bug #22082, Lua disaster signal can't suppress...

 
 
Show feedback again

bug #22082: Lua disaster signal can't suppress message "We survived the disaster without serious damages."

Submitted by:  Jacob Nevins <jtn>
Submitted on:  Sun 25 May 2014 11:08:34 AM UTC  
 
Category: generalSeverity: 3 - Normal
Priority: 5 - NormalStatus: Fixed
Assigned to: Marko Lindqvist <cazfi>Open/Closed: Closed
Release: Operating System: Any
Planned Release: 2.5.0, 2.6.0

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Tue 30 Dec 2014 04:41:17 AM UTC, SVN revision 27449:

Removed the message about how city survived a disaster without any serious effects
since we cannot know if lua script implements something for such a disaster not having
internal effects.

Requested by Jacob Nevins

See bug #22082

(Browse SVN revision 27449)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Tue 30 Dec 2014 04:34:39 AM UTC, SVN revision 27448:

Moved printing the message about how city survived a disaster without any serious effects
to the default.lua script, so lua scripts can suppress it if scripts themself implement some effect.

Requested by Jacob Nevins

See bug #22082

(Browse SVN revision 27448)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sun 28 Dec 2014 10:35:34 PM UTC, comment #6:

> Why 2 and not 3 in your patch?


Thanks. Corrected patch attached.

(file #23321)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sun 28 Dec 2014 11:17:10 AM UTC, comment #5:

>Trunk version: boolean passed to lua script, default.lua outputting the message when appropriate.

Very interesting, I read your patch. I have a question... Why 2 and not 3 in your patch?
and the same...

J. M. Gorbach <gorb>
Mon 22 Dec 2014 09:55:20 PM UTC, comment #4:

Trunk version: boolean passed to lua script, default.lua outputting the message when appropriate.

The idea is that ruleset-specific script.lua should prevent default.lua script from running when it has implemented some special disaster effect.

(file #23267)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Mon 22 Dec 2014 07:05:22 AM UTC, comment #3:

S2_5 version: Get rid of the message.

(file #23260)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Thu 29 May 2014 08:20:25 PM UTC, comment #2:

In S2_5 we can't move it to lua as the signal does not tell if some of the engine side effects fired.

So in S2_5 we should just get rid of the message.

In TRUNK we should at least pass boolean in lua signal telling if any of the internal effects fired. It's more complicated question if we then use that information in default.lua or ruleset specific script.lua.

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Mon 26 May 2014 06:57:44 AM UTC, comment #1:

> Perhaps we can move the emission of the message to a default signal handler in default.lua instead, and make emitting the message ruleset Lua's responsibility?


I agree.

J. M. Gorbach <gorb>
Sun 25 May 2014 11:08:34 AM UTC, original submission:

In apply_disaster(), if none of the built-in disasters fire, the message "We survived the disaster without serious damages." is emitted before the script signal fires. This may be unwanted for disasters implemented in Lua.

Unfortunately I don't think there's any way for the Lua signal handler to return whether a disaster occurred. Perhaps we can move the emission of the message to a default signal handler in default.lua instead, and make emitting the message ruleset Lua's responsibility?

(Alternatively we could just get rid of the message.)

Jacob Nevins <jtn>
Project Administrator

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #23267:  LuaHarmlessDisaster.patch added by cazfi (4kB - text/x-diff)
file #23260:  SilentSurvival.patch added by cazfi (2kB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by cazfi (Posted a comment)
  • -unavailable- added by gorb (Posted a comment)
  • -unavailable- added by jtn (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 30 Dec 2014 04:41:30 AM UTCcazfiStatusReady For Test=>Fixed
      Assigned toNone=>cazfi
      Open/ClosedOpen=>Closed
    Sun 28 Dec 2014 10:35:34 PM UTCcazfiAttached File-=>Added LuaHarmlessDisaster-2.patch, #23321
    Mon 22 Dec 2014 09:55:20 PM UTCcazfiAttached File-=>Added LuaHarmlessDisaster.patch, #23267
      CategoryNone=>general
    Mon 22 Dec 2014 07:05:22 AM UTCcazfiAttached File-=>Added SilentSurvival.patch, #23260
      StatusNone=>Ready For Test
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup