mirror of
				https://github.com/OpenFusionProject/OpenFusion.git
				synced 2025-10-31 16:50:12 +00:00 
			
		
		
		
	Compare commits
	
		
			1 Commits
		
	
	
		
			2464e4adda
			...
			50df74212b
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 50df74212b | 
							
								
								
									
										3
									
								
								.github/workflows/check-builds.yaml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.github/workflows/check-builds.yaml
									
									
									
									
										vendored
									
									
								
							| @@ -9,13 +9,12 @@ on: | ||||
|         - CMakeLists.txt | ||||
|         - Makefile | ||||
|   pull_request: | ||||
|     types: [opened, reopened, synchronize, ready_for_review] | ||||
|     types: ready_for_review | ||||
|     paths: | ||||
|         - src/** | ||||
|         - vendor/** | ||||
|         - CMakeLists.txt | ||||
|         - Makefile | ||||
|   workflow_dispatch: | ||||
|  | ||||
| jobs: | ||||
|   ubuntu-build: | ||||
|   | ||||
| @@ -51,11 +51,6 @@ motd=Welcome to OpenFusion! | ||||
| # and pre-Academy builds must *not* contain it. | ||||
| #enabledpatches=1013 | ||||
|  | ||||
| # Use Original FusionFall's racing score and reward calculation? | ||||
| # Set false to use Retro's calculation, make sure you have the correct | ||||
| # patch(es) loaded. | ||||
| #ogracingscores=true | ||||
|  | ||||
| # xdt json filename | ||||
| #xdtdata=xdt.json | ||||
| # NPC json filename | ||||
|   | ||||
| @@ -101,13 +101,17 @@ static void racingEnd(CNSocket* sock, CNPacketData* data) { | ||||
|  | ||||
|     EPInfo& epInfo = EPData[mapNum]; | ||||
|     EPRace& epRace = EPRaces[sock]; | ||||
|     // if there are no divide-by-zero dangers, and at least one factor has been specified | ||||
|     // we switch over to OG scoring | ||||
|     bool useOGScoring = (epInfo.maxPods > 0) && (epInfo.maxTime > 0) && ( | ||||
|         (epInfo.scaleFactor > 0.0) || (epInfo.podFactor > 0.0) || (epInfo.timeFactor > 0.0)); | ||||
|  | ||||
|     uint64_t now = getTime() / 1000; | ||||
|     int timeDiff = now - epRace.startTime; | ||||
|     int podsCollected = epRace.collectedRings.size(); | ||||
|     int score = 0, fm = 0; | ||||
|  | ||||
|     if (settings::OGRACINGSCORES) { | ||||
|     if (useOGScoring) { | ||||
|         score = std::min(epInfo.maxScore, (int)std::exp( | ||||
|             (epInfo.podFactor * podsCollected) / epInfo.maxPods | ||||
|             - (epInfo.timeFactor * timeDiff) / epInfo.maxTime | ||||
|   | ||||
| @@ -589,12 +589,28 @@ static void loadDrops(json& dropData) { | ||||
|             // time limit isn't stored in the XDT, so we include it in the reward table instead | ||||
|             epInfo.maxTime = (int)race["TimeLimit"]; | ||||
|  | ||||
|             // the following has to be present based on the score calculation method | ||||
|             if (settings::OGRACINGSCORES) { | ||||
|             // update max score (if present) | ||||
|             if (race.find("ScoreCap") != race.end()) { | ||||
|                 epInfo.maxScore = (int)race["ScoreCap"]; | ||||
|             } | ||||
|  | ||||
|             // update max pods (if present) | ||||
|             if (race.find("TotalPods") != race.end()) { | ||||
|                 epInfo.maxPods = (int)race["TotalPods"]; | ||||
|             } | ||||
|  | ||||
|             // update scale factor (if present) | ||||
|             if (race.find("ScaleFactor") != race.end()) { | ||||
|                 epInfo.scaleFactor = (double)race["ScaleFactor"]; | ||||
|             } | ||||
|  | ||||
|             // update pod factor (if present) | ||||
|             if (race.find("PodFactor") != race.end()) { | ||||
|                 epInfo.podFactor = (double)race["PodFactor"]; | ||||
|             } | ||||
|  | ||||
|             // update time factor (if present) | ||||
|             if (race.find("TimeFactor") != race.end()) { | ||||
|                 epInfo.timeFactor = (double)race["TimeFactor"]; | ||||
|             } | ||||
|  | ||||
|   | ||||
| @@ -67,9 +67,6 @@ int settings::MONITORINTERVAL = 5000; | ||||
| // event mode settings | ||||
| int settings::EVENTMODE = 0; | ||||
|  | ||||
| // racing score mode | ||||
| bool settings::OGRACINGSCORES = true; | ||||
|  | ||||
| void settings::init() { | ||||
|     INIReader reader("config.ini"); | ||||
|  | ||||
| @@ -114,7 +111,6 @@ void settings::init() { | ||||
|     EVENTMODE = reader.GetInteger("shard", "eventmode", EVENTMODE); | ||||
|     DISABLEFIRSTUSEFLAG = reader.GetBoolean("shard", "disablefirstuseflag", DISABLEFIRSTUSEFLAG); | ||||
|     ANTICHEAT = reader.GetBoolean("shard", "anticheat", ANTICHEAT); | ||||
|     OGRACINGSCORES = reader.GetBoolean("shard", "ogracingscores", OGRACINGSCORES); | ||||
|     MONITORENABLED = reader.GetBoolean("monitor", "enabled", MONITORENABLED); | ||||
|     MONITORPORT = reader.GetInteger("monitor", "port", MONITORPORT); | ||||
|     MONITORINTERVAL = reader.GetInteger("monitor", "interval", MONITORINTERVAL); | ||||
|   | ||||
| @@ -38,7 +38,6 @@ namespace settings { | ||||
|     extern int MONITORPORT; | ||||
|     extern int MONITORINTERVAL; | ||||
|     extern bool DISABLEFIRSTUSEFLAG; | ||||
|     extern bool OGRACINGSCORES; | ||||
|  | ||||
|     void init(); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user