private static bool Prefix(int gameCell, float kilojoules, float max_temperature, EnergySourceID id) { SimMessages_Utils.Log(MethodBase.GetCurrentMethod(), gameCell, kilojoules, max_temperature, id); return(true); }
public unsafe static void ModifyEnergy(int gameCell, float kilojoules, float max_temperature, EnergySourceID id) { if (Grid.IsValidCell(gameCell)) { if (max_temperature <= 0f) { Debug.LogError("invalid max temperature for cell energy modification"); } else { ModifyCellEnergyMessage *ptr = stackalloc ModifyCellEnergyMessage[1]; ptr->cellIdx = gameCell; ptr->kilojoules = kilojoules; ptr->maxTemperature = max_temperature; ptr->id = (int)id; Sim.SIM_HandleMessage(818320644, sizeof(ModifyCellEnergyMessage), (byte *)ptr); } } }