diff --git a/src/monocoque/devices/serial/arduinoledlua.c b/src/monocoque/devices/serial/arduinoledlua.c index 3fc8dc8..a608d25 100644 --- a/src/monocoque/devices/serial/arduinoledlua.c +++ b/src/monocoque/devices/serial/arduinoledlua.c @@ -28,6 +28,9 @@ int simdata_to_lua(lua_State *L, SimData* simdata) { lua_newtable(L); + lua_pushstring(L, simdata->gearc); + lua_setfield(L, -2, "gearc"); + lua_pushinteger(L, simdata->playerflag); lua_setfield(L, -2, "playerflag"); diff --git a/src/monocoque/gameloop/gameloop.c b/src/monocoque/gameloop/gameloop.c index 8c8a4bb..d9b8d5c 100644 --- a/src/monocoque/gameloop/gameloop.c +++ b/src/monocoque/gameloop/gameloop.c @@ -651,6 +651,8 @@ int tester(SimDevice* devices, int numdevices) simdata->car[3] = '\0'; simdata->gear = MONOCOQUE_GEAR_NEUTRAL; + simdata->gearc[0] = 0x4e; + simdata->gearc[1] = 0; simdata->velocity = 16; simdata->rpms = 100; simdata->maxrpm = 8000; @@ -681,6 +683,7 @@ int tester(SimDevice* devices, int numdevices) fprintf(stdout, "Shifting into first gear\n"); simdata->gear = 2; + simdata->gearc[0] = 0x31; for (int x = 0; x < numdevices; x++) { if (devices[x].initialized == true) @@ -746,6 +749,7 @@ int tester(SimDevice* devices, int numdevices) simdata->tyrediameter[3] = -1; simdata->abs = 0; simdata->gear = 3; + simdata->gearc[0] = 0x32; for (int x = 0; x < numdevices; x++) { if (devices[x].initialized == true) @@ -799,6 +803,7 @@ int tester(SimDevice* devices, int numdevices) fprintf(stdout, "Shifting into third gear\n"); simdata->gear = 4; + simdata->gearc[0] = 0x33; for (int x = 0; x < numdevices; x++) { if (devices[x].initialized == true) @@ -835,6 +840,7 @@ int tester(SimDevice* devices, int numdevices) fprintf(stdout, "Shifting into fourth gear\n"); simdata->gear = 5; + simdata->gearc[0] = 0x34; for (int x = 0; x < numdevices; x++) { if (devices[x].initialized == true) @@ -893,6 +899,7 @@ int tester(SimDevice* devices, int numdevices) simdata->velocity = 0; simdata->rpms = 100; simdata->gear = MONOCOQUE_GEAR_NEUTRAL; + simdata->gearc[0] = 0x4e; for (int x = 0; x < numdevices; x++) { if (devices[x].initialized == true)