pastebin

Paste #4cJ -- näytä pelkkänä tekstinä -- uusi tämän pohjalta

Värjäys: Tyyli: ensimmäinen rivinumero: Tabin korvaus:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
diff --git a/src/game.cpp b/src/game.cpp
index 30d9c7f..c53465a 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -70,6 +70,38 @@
 #include <list>
 #include "util/directiontables.h"
 
+static std::string romani_ranch(s32 n)
+{
+	std::ostringstream os(std::ios::binary);
+	if(n == 0)
+		os<<"O";
+	if(n < 0){
+		os<<"-";
+		n = -n;
+	}
+	const char *z = "MDCLXVI ";
+	for(s32 k = 1000; k; k /= 10, z += 2) {
+		int l = k/10;
+		while(n >= k){
+			os<<*z;
+			n -= k;
+		}
+		if(l && n >= 9*l){
+			os<<z[2]<<*z;
+			n -= 9*l;
+		}
+		if(l && n >= 5*l){
+			os<<z[1];
+			n -= 5*l;
+		}
+		if(l && n >= 4*l){
+			os<<z[2]<<z[1];
+			n -= 4*l;
+		}
+	}
+	return os.str();
+}
+
 /*
 	Text input system
 */
@@ -3019,9 +3051,9 @@ void the_game(
 		{
 			std::ostringstream os(std::ios_base::binary);
 			os<<std::setprecision(1)<<std::fixed
-				<<"(" <<(player_position.X/BS)
-				<<", "<<(player_position.Y/BS)
-				<<", "<<(player_position.Z/BS)
+				<<"(" <<romani_ranch(player_position.X/BS)
+				<<", "<<romani_ranch(player_position.Y/BS)
+				<<", "<<romani_ranch(player_position.Z/BS)
 				<<") (yaw="<<(wrapDegrees_0_360(camera_yaw))
 				<<") (seed = "<<((unsigned long long)client.getMapSeed())
 				<<")";