From: <av...@us...> - 2011-05-17 18:45:27
|
Revision: 3614 http://sc2.svn.sourceforge.net/sc2/?rev=3614&view=rev Author: avolkov Date: 2011-05-17 18:45:21 +0000 (Tue, 17 May 2011) Log Message: ----------- Update a Melnorme number speech call missed in r3610 Modified Paths: -------------- trunk/sc2/src/uqm/comm/melnorm/melnorm.c Modified: trunk/sc2/src/uqm/comm/melnorm/melnorm.c =================================================================== --- trunk/sc2/src/uqm/comm/melnorm/melnorm.c 2011-05-16 21:01:22 UTC (rev 3613) +++ trunk/sc2/src/uqm/comm/melnorm/melnorm.c 2011-05-17 18:45:21 UTC (rev 3614) @@ -590,7 +590,7 @@ else { NPCPhrase (NEED_MORE_CREDIT0); - NPCPhrase (delta_credit + (int)Credit); + NPCNumber (-delta_credit - Credit, NULL); NPCPhrase (NEED_MORE_CREDIT1); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-08-30 15:59:45
|
Revision: 3678 http://sc2.svn.sourceforge.net/sc2/?rev=3678&view=rev Author: avolkov Date: 2011-08-30 15:59:39 +0000 (Tue, 30 Aug 2011) Log Message: ----------- Fix double free() of RandomContext in Melnorme comm Modified Paths: -------------- trunk/sc2/src/uqm/comm/melnorm/melnorm.c Modified: trunk/sc2/src/uqm/comm/melnorm/melnorm.c =================================================================== --- trunk/sc2/src/uqm/comm/melnorm/melnorm.c 2011-08-28 20:22:44 UTC (rev 3677) +++ trunk/sc2/src/uqm/comm/melnorm/melnorm.c 2011-08-30 15:59:39 UTC (rev 3678) @@ -712,8 +712,8 @@ end_mod = which_module; ++module_count[which_module]; total += GLOBAL (ModuleCost[which_module]); - RandomContext_Delete (rc); } + RandomContext_Delete (rc); if (total == 0) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-09-01 17:48:17
|
Revision: 3679 http://sc2.svn.sourceforge.net/sc2/?rev=3679&view=rev Author: avolkov Date: 2011-09-01 17:48:11 +0000 (Thu, 01 Sep 2011) Log Message: ----------- Account for slight movement in HyperSpace due to encounters in Melnorme strip ship random seed; bug #567 Modified Paths: -------------- trunk/sc2/src/uqm/comm/melnorm/melnorm.c Modified: trunk/sc2/src/uqm/comm/melnorm/melnorm.c =================================================================== --- trunk/sc2/src/uqm/comm/melnorm/melnorm.c 2011-08-30 15:59:39 UTC (rev 3678) +++ trunk/sc2/src/uqm/comm/melnorm/melnorm.c 2011-09-01 17:48:11 UTC (rev 3679) @@ -558,6 +558,22 @@ return 0; } +static DWORD +getStripRandomSeed (void) +{ + DWORD x, y; + // We truncate the location because encounters move the ship slightly in + // HSpace, and throw some other relatively immutable values in the mix to + // vary the deal when stuck at the same general location again. + // It is still possible but unlikely for encounters to move the ship into + // another truncation sector so the player could choose from 2 deals. + x = LOGX_TO_UNIVERSE (GLOBAL_SIS (log_x)) / 100; + y = LOGY_TO_UNIVERSE (GLOBAL_SIS (log_y)) / 100; + // prime numbers help randomness + return y * 1013 + x + GLOBAL_SIS (TotalElementMass) + + GLOBAL_SIS (NumLanders); +} + static BOOLEAN StripShip (COUNT fuel_required) { @@ -619,7 +635,7 @@ // a repeatable pseudo-random function of where we got stuck and what, // exactly, is on our ship. rc = RandomContext_New(); - RandomContext_SeedRandom(rc, GLOBAL_SIS (log_y) * LOG_UNITS_X + GLOBAL_SIS (log_x)); + RandomContext_SeedRandom (rc, getStripRandomSeed ()); SIS_copy = GlobData.SIS_state; for (i = PLANET_LANDER; i < BOMB_MODULE_0; ++i) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-09-01 18:58:19
|
Revision: 3680 http://sc2.svn.sourceforge.net/sc2/?rev=3680&view=rev Author: avolkov Date: 2011-09-01 18:58:13 +0000 (Thu, 01 Sep 2011) Log Message: ----------- Remove TotalElementMass from the strip ship random seed mix because the player can dump cargo and change the seed; bug #567 Modified Paths: -------------- trunk/sc2/src/uqm/comm/melnorm/melnorm.c Modified: trunk/sc2/src/uqm/comm/melnorm/melnorm.c =================================================================== --- trunk/sc2/src/uqm/comm/melnorm/melnorm.c 2011-09-01 17:48:11 UTC (rev 3679) +++ trunk/sc2/src/uqm/comm/melnorm/melnorm.c 2011-09-01 18:58:13 UTC (rev 3680) @@ -570,8 +570,9 @@ x = LOGX_TO_UNIVERSE (GLOBAL_SIS (log_x)) / 100; y = LOGY_TO_UNIVERSE (GLOBAL_SIS (log_y)) / 100; // prime numbers help randomness - return y * 1013 + x + GLOBAL_SIS (TotalElementMass) - + GLOBAL_SIS (NumLanders); + return y * 1013 + x + GLOBAL_SIS (NumLanders) + + GLOBAL_SIS (ModuleSlots[1]) + GLOBAL_SIS (ModuleSlots[4]) + + GLOBAL_SIS (ModuleSlots[7]) + GLOBAL_SIS (ModuleSlots[10]); } static BOOLEAN This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |